give nonempty array nonnegative integer num degree array define maximum frequency elementsyour task find small possible length contiguous subarray nums degree num Example 1input num 12231output 2explanation the input array degree 2 element 1 2 appear twiceOf subarray degree1 2 2 3 1 1 2 2 3 2 2 3 1 1 2 2 2 2 3 2 2the short length 2 so return 2example 2input num 1223142output 6explanation the degree 3 element 2 repeat 3 timesSo 223142 short subarray return 6 Constraintsnumslength 1 50000numsi integer 0 49999