Longest Path on Grid
CodeChefOpen on judge ↗
Given a grid of dimensions $N \times M$, you have to find the length of the longest path from one point to another with some obstacles in the grid. You cannot visit the cells you have visited before in a path. If there is no path, print $-1$ ### Input: - First line of input contains the number of test cases $T$. Then the test cases follow. - The first line of each test case consists of two sp
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