Coding Challenge

Same Tree

Easy
treedfs

Check whether two binary trees are structurally identical.

Return true if two binary trees have the same structure and node values.

Examples

Input: p = [1,2,3], q = [1,2,3]

Output: true

Constraints

  • Trees may be empty

Preparing your coding workspace...