Count the number of sub-arrays with at least k pairs of indices (i, j) such that i < j and arr[i] == arr[j] in a given array.
Given an integer array arr and an integer k, count the number of good sub-arrays of arr. A sub-array arr is good if there are at least k pairs of indices [ i, j ] such that i < j and arr[i] == arr[j].
Examples :
Input: arr = [3,1,4,3,2,2,4], k = 2 O...
decocodes.hashnode.dev10 min read