Amazon interview question

Review your DP and Graph problems