I have tried my level best to understand this problem.Could anyone else please explain me how i solve this problem?
Note: I know Binary Indexed tree and want to solve this problem by this algorithm.Google search couldn't make a sense for myself to solve this problem.Everywhere,i saw,sort query according to it's value 'k'.And suggestion was that sort your given array also..But,i failed to get that!Pure explanation needed!
Thanks in advance!
Hi, I just solved your problem.
Here is my Accepted code
Don't care about this gray newbie, just enjoy my standup
which language you have written in your blog post!Google translator is my only one friend for this purpose!
Ignore him. He is a spammer.