← All problemsSign in

Problem 3

Problem 3 Angel Priya has ‘k’ horses in a stable of length just one above the number of horses. The horses are numbered from '1' to 'k' and are initially placed at positions starting from position 1 till position k. The horses are moving either in the left direction (denoted by '-1') or in the right direction (denoted by '1'). Whenever horse crosses the fence of the stable it goes out of the stab

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start