Google interview question

Leetcode medium questions about trees and arrays.