Amazon interview question

Tree and array based along wit dynamic programming