Count Distinct Values in a Huge Sorted Array
Count Distinct Values in a Huge Sorted Array
Given a huge non-decreasing integer array arr, return the number of distinct values. Let n be the length and k the number of distinct values, wher...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
