I recently read this blog and tried to implement this data structure in problem 455D - Serega and Fun mentioned in comments but it's getting WA and I can't seem to find any bug in my data structure implementation , I know asking you all to debug my code is not good but it's a desperate move :<(
In my implementation i havn't stored size of each block as in the problem we are swapping so there's never going to be too many or too less blocks