Count number of occurrences (or frequency) of each element in a sorted array
One algorithm that can be used to count the number of occurrences (or frequency) of each element in a sorted array is called the "Two Pointers" algorithm.
Here's how it works:
Initialize two pointers, i and j, to the first element of the array.
Com...
shohanur.hashnode.dev4 min read