import { uniqueCountSorted } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";
For a sorted input, counting the number of unique values is possible in constant time and constant memory. This is a simple implementation of the algorithm.
Values are compared with ===
, so objects and non-primitive objects
are not handled in any special way.