Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 349 Bytes

NorMoreOccurrences.md

File metadata and controls

13 lines (8 loc) · 349 Bytes

N or More Occurrences

Write a function that counts the minimum number of occurrences in an array. The first argument is the provided array, the second argument is how many times to count the occurrence.

Example

let arr = [1,3,4,1,9,1,3,4,3,1,2]

elements(arr, 2) // Should return: [1,3,4]
elements(arr, 3) // Should return: [1,3]