How to find total numbers having frequency=kin a particular range(l,r) in a given array. There are total 10^5 queries of formatl,rand each query is built on the basis of previous query's answer. In particular, after each query we incrementlby the result of the query, swappinglandrifl>r. Note that0<=a[i]<=10^9. Total elements in array isn=10^5.