Skip to content

Latest commit

 

History

History

countuniquevalues

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Count unique values

Instructions

Given a sorted list of integers implement a function which counts the unique values.

Challenge | Solution

Examples

countUniqueValues([]) // 0

countUniqueValues([1, 1, 6]) // 2

countUniqueValues([-2, -1, -1, 0, 1]) // 4