← All problemsSign in

Yet Another Palindromic Problem

CodeChefRating 2555Open on judge ↗

Chef is given a rooted tree with $N$ nodes numbered $1$ to $N$ where $1$ is the root node. Each node is assigned a lowercase english alphabet between `a` to `z` (both included). Given two nodes $A$ and $B$: - Let $LCA(A, B)$ denote the [lowest common ancestor](https://en.wikipedia.org/wiki/Lowest_common_ancestor) of nodes $A$ and $B$. - Let $DIS(A,B)$ denote the string containing all the chara

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