Amazon interview question

merge array, and validate binary tree