I need help in a question. It came to one of the contest I gave around 4 days ago. It was a hiring contest of a good indian company.
My approach was to store ai and bi as pairs in vector and sort them. So for each query we can get the count of chocolates having sweetness greater than x using binary search on vector but now how to get the count of lifetime greater than y? I got stuck here. I still couldn't think of something. Can you tell me how to approach?
It'll be really great if anyone can help me or give me some insight.