Calculating moves
CodeChefOpen on judge ↗
You are given a matrix that has zeros and ones. At each cell in the matrix you can go in the following directions: - north - south - east - west Considering each move as a single step, compute the number of moves it will take you to reach the nearest zero element for each cell in the matrix. ### Input: - 3 lines, each representing a row of a matrix. - Every line contains cell-values separated by
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