Fastest Way To Murph
CodeChefOpen on judge ↗
Joseph Cooper wants to get back to his daughter Murph Cooper. He is currently on day $N$ of the week and Murph is on day $M$ of the week. He can either wait for day M to arrive or he can use a time machine to go back in time and reach day M. Note that the days have numbers assigned to them eg. Monday = 1, Tuesday = 2, ..., Sunday = 7. Find the minimum possible number of days required to
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.
Sign in to chat with the tutor and save your progress.
Sign in to start