DSDecostar Sharmaindecocodes.hashnode.dev·Mar 5, 2023 · 4 min readWhat is Recursion ?Recursion is basically a technique of problem-solving in which a function calls itself again and again till a particular base case. The function calls itself with the help of parameters and at each call, the value of the parameter decreases or increa...00
DSDecostar Sharmaindecocodes.hashnode.dev·Mar 5, 2023 · 10 min readCount 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...00