Each node only knows its parent. Given two nodes, count the edges between them — ideally without any extra memory.
Each node only knows its parent. Given two nodes, count the edges between them — ideally without any extra memory.
Opens with the full question.