All Problems

Degree of an Array

EasyarrayExpected: O(n) time, O(n) spaceInterview Context
hash-map

Problem

Given a non-empty array, find the smallest length of a contiguous subarray that has the same degree as the array.

Loading...