Given a list of integers arr, return the length of the shortest contiguous subarray that contains every distinct value that appears anywhere in arr. If arr is empty, return 0. Examples: - For arr = [1, 2, 2, 3, 1, 2, 3], the set of distinct values is {1,2,3}. The shortest contiguous subarray containing all three values has length 3 (e.g. [2,3,1]), so the answer is 3. Constraints: expected time O(n) and O(d) extra space where d is the number of distinct values in arr.
([1, 2, 2, 3, 1, 2, 3],)3