atlasworld's blog

By atlasworld, history, 4 years ago, In English

The problem asks to toggle bits in a given range that after certain operations all bits becomes 0 .

My O(N2) solution is for a given light bulb if it is on the switch it off and update all the given ranges , but this will be N^2 complexity . How can we reduce it to O(n) . The last lines of the editorial i couldn't understood , how the author is updating the ranges .

how to do it . ?

Can anyone help me what the author is done in this code
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?