Find balanced subarray and increasing tree path | Meta Interview Question