Motu and Patlu
CodeChefOpen on judge ↗
Patlu wants to make apple pie for Motu. So he goes to the orchid for apples. Now the orchid has apple and mango trees arranged in square matrix of order N. Such that he doesn’t get bored while apple picking, he decides to do it in a pattern. He always starts and end at the boundary cells of the matrix and travels only those paths that has apple trees only. He will cover the entire matrix by moving
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