Driver code
let arr = [ 2 , 3 , 3 , 2 , 5 ] ; findCounts ( arr , arr . length ) ; let arr1 = [ 1 ] ; findCounts ( arr1 , arr1 . length ) ; let arr3 = [ 4 , 4 , 4 , 4 ] ; findCounts ( arr3 , arr3 . length ) ; let arr2 = [ 1 , 3 , 5 , 7 , 9 , 1 , 3 , 5 , 7 , 9 , 1 ] ; findCounts ( arr2 , arr2 . length ) ; let arr4 = [ 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 ] ; findCounts ( arr4 , arr4 . length ) ; let arr5 = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 ] ; findCounts ( arr5 , arr5 . length ) ; let arr6 = [ 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 ] ; findCounts ( arr6 , arr6 . length ) ;