Count Unique Values
SoftServeCiklum
Write a function that counts the number of unique values in a sorted array.
Example:
Input: [1, 1, 1, 2, 3, 3, 4, 5, 5, 5]
Output: 5
Examples:
Input 1:
{"arr":[1,1,1,2,3,3,4,5,5,5]}Output 1:
5Input 2:
{"arr":[1,2,3,4,5]}Output 2:
5Loading editor...
Run your code to see results
Click the Run button above