Find Minimum Steps (Keteki)
CodeChefOpen on judge ↗
Given a 2d array. Value of column j in row i will be a 0 if the cell is empty. If its a 1 it is source and 2 is destination. Print the minimum number of steps needed to move from source to destination if diagonal movement is not allowed. Only top, down, left and right movements are allowed. Input: X Y(the number of row and columns) n00 n01 n02 ...n0(Y-1) n10 n11 n12...n1(Y-1) . . . n(X-1)0
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