medium10 pts · first answer countshash-mapcounting
Shortest subarray with the same degree
The degree of an array is the highest frequency of any value. What is the length of the shortest subarray of [1, 2, 2, 3, 1] with the same degree?
Discussion 0
Join free to post in the discussion.
Related questions
- Paths across a 3 × 7 gridBackend Developer
- Average cost of a hash map lookupBackend Developer
- Worst case for a hash map lookupBackend Developer
- Removing duplicates with a SetBackend Developer
- Number keys in a plain objectBackend Developer
- Iteration order of a MapBackend Developer
- When to choose Map over a plain objectBackend Developer
- Set of look-alike objectsBackend Developer