I tried to solve the below code using dynamic programming but Couldnot able to pass all the test cases for this question. It's like a medium range question. Try to use any technique/pattern to solve this challange. I have faced in Amazon interview.
If you can able to code and pass all the test cases. Consider, sharing your solution in comments.



#amazon #codingchallenge #interview #