Exchanging coins 1 D Dp

This code is giving TLE

@avinashmallik2017
Your base case was wrong. I have made the required changes.