← All problemsSign in

A to B

CodeChefRating 2118Open on judge ↗

You are given two points $A = (x_1, y_1, z_1)$ and $B = (x_2, y_2, z_2)$ in the 3D coordinate system. You would like to start at point $A$ and reach point $B$. To do this, you can move in any of the $6$ cardinal directions — up, down, left, right, front or back — one step at a time. Formally, in one step, you can choose exactly one coordinate and either increase or decrease it by $1$. Howev

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start