rahul_1234's blog

By rahul_1234, history, 10 years ago, In English

Hi, I wanted to solve this question in O(N) but couldn't think of it. I did it in O(N logN ) using priority queue but can somebody provide me O(N) solution.

https://postimg.org/image/c31iexg13/

The link of question is not opening now, so I have shared the pic of question.

  • Vote: I like it
  • -15
  • Vote: I do not like it

»
10 years ago, hide # |
← Rev. 2  
Vote: I like it -18 Vote: I do not like it

no comments