Evan_Shareef's blog

By Evan_Shareef, history, 3 years ago, In English

I have read the editorial but yet not cleared enough about the approach. Can anyone provide me some hints? How to approach this problem? I just need to know about the observation that how you will approach the problem to solve it.

Problem

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Do you know the technique of marking ranges on an array? You use the indices of the array as the bounds of the ranges and put +1 to the left bound and -1 to the index one position of the right bound.

You have to do the same, just use a map to do it.