How to solve the following problem
I am using binary search but not able to solve

You can check mine solution i have solved it using map .
here is my code code
I hope you will find it useful :smile: :smile:


can you plz explain your code what you actually want to do.