Share your repls and programming experiences

← Back to all posts
7.6. Lists: Number of distinct elements
pole55 (78)

Given a list of numbers with all elements sorted in ascending order, determine and print the number of distinct elements in it.

Example input: 1 2 2 3 3 3
Example output: 3