Can anyone help me with this?

Revision en1, by _amit.nehra_, 2023-11-28 07:11:14

There are N numbers(1 to N), arranged in increasing order. There are q operation that has to be performed on permutation. In ith operation, we'll have Li, Ri(two indices) and we have to reverse the permutation from arr[Li] to arr[Ri]. At last, after performing all operations, we have to return value at kth position.

N<=10^9 q<=10^5 1<= Li, Ri <=N k<=N

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English _amit.nehra_ 2023-11-28 07:12:45 8
en1 English _amit.nehra_ 2023-11-28 07:11:14 391 Initial revision (published)