https://ide.codingblocks.com/s/243322 Shows correct answer for two test cases but fails for 1
1 test case going wrong
@tanjuljain19 changed base case because your code was failing when there is 0 at n-1,n-1 ur code was not updating that value it remained 0
hope its clear if yes don’t forget to mark the doubt as resolved 
thanks a lot for solving my query