← All problemsSign in

STRANGE TREE

Chef is fond of constructing new trees. Today he is developing one more tree in a 2D co-ordinate system consisting of $N$ nodes. Properties of tree are as follows: - Root Node is indexed at $1$ having co-ordinates $(0,0)$. - Each Node has $atmost$ $3$ childrens. - If a node is at co-ordinate $(x,$ $y)$, it's childrens are co-ordinates $(x,$ $y+1),$ $(x+1,$ $y+1),$ $(x+2,$ $y+1)$. - Tree can accom

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