Company: Publicis Sapient
Difficulty: medium
Degree of an Array Problem Description Given a non-empty array of non-negative integers nums , the degree of this array is defined as the maximum frequency of any one of its elements. Your task is to find the smallest possible length of a continuous subarray of nums , that has the same degree as nums . #include <iostream> #include <vector> #include <algorithm> // Potentially other includes like <map> for frequency counting // function to find the smallest length subarray with the same degree as the array int findShortestSubarray(vector & nums) { // Enter your code here } int main() { int n; // enter the size of the array std::cout > n; // input size of the array std::vector nums(n); // Declare the array std::cout > nums[i]; // input array elements } std::cout