The TransCompilator

Solved LeetCode program · 1000 of 1,000

#1379 · Find a Corresponding Node of a Binary Tree in a Clone of That Tree

Easy Depth-First Search chunk-20.md

Original English source

Keep a shared cloned holding 7, 4, 3, 6, and 19. Keep a shared clonelefts holding 1, -1, 3, -1, and -1. Keep a shared clonerights holding 2, -1, 4, -1, and -1. Keep a shared target of 3. Keep a shared found of 0.

To seek from node (a whole number). If node is less than 0, return. If item node of cloned is target, set found to node, return. Seek from item node of clonelefts. Seek from item node of clonerights.

Seek from 0. The at is found. Show item at of cloned.

Open in Playground Browse all 1,000 problems

Expected stdout

3