Extra question.....help please

can u code it fully ???

question -->

Hey @hg11110000
Refer to its solution https://codeforces.com/problemset/problem/25/D?mobile=false

@Kartikkhariwal1

and how is the backtracking working in this…i m not able to catch ???
please explain

yes i have done backtracking…

but i m not able to solve a new question ??

how to build logic

i was knowing that this is a question of backtracking
but wasnt able to even think
how to approach

can u help please ?

how is the flow going…how it is reaching king…
i m not able, to think recursion flow in backtracking questions

Hey @hg11110000
Please open another doubt because its a different question.

Before opening it ,my suggestion is print whatever u are doing for each recursion call and see whats happening in real