Skip to main content

Count Unique Values

JUNIOR
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:5
Input 2:{"arr":[1,2,3,4,5]}
Output 2:5

Loading editor...

Run your code to see results

Click the Run button above