How to do this?

Revision en1, by maybesomeone, 2022-07-16 11:02:24

let array A = {1,3,1,1,1,4,0,0,2,3,1,}

We have to do following 2 operations on it

1.)Decrease all elements from L to R by 1

2.)Given i find right most element j such that for each k. i <= k <= j. A[k] > 0

how can i do this in log(N) ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English maybesomeone 2022-07-16 11:02:24 269 Initial revision (published)