Algorithm · Google · Easy
Unique Number of Occurrences Easy · Array, Hash Table · Amazon, Google · Hint: Count frequencies and check for duplicates. You are given an integer array arr. For each distinct value that appears in arr, count the number of times it occurs. Let's call these counts "frequencies". Determine whether all frequencies are pairwise distinct. In other words, check if any two different numbers share the same occurrence count. Return true if every frequency is unique; otherwise,…
Checking your access…