WA in BIT3D

https://www.codechef.com/viewsolution/36225837
I hv stored the max element which can be reached using queue and then tried to solve.
pls help.

Its really good to ask, but rather than giving solution link, try to explain what have you tried and whats going wrong. that would help others a lot to answer your question, because understanding code is difficult and time consuming. :slightly_smiling_face:

i hv run a loop frm back thn i hv stored the elements with same ev or odd as 1st element then if distance is greater than k then i hv popped the element and at last counted total jumps.