Warner Bros. Discovery interview question

Binary search, DP, dp rectangle