TikTok interview question

Leetcode medium binary trees and so on