Some test cases getting wron and run error

I have used ans==0 condition for getting only one test case as output…

@piyush.bansal8158625 You must initialize the output matrix before with 0
Follow this:

Last test case still failing and whats the reason for not using rightS||downS together.

Please check with this code. 2 test cases still failing…1 tle and 1 wrong
@aman212yadav

@piyush.bansal8158625
i think u tagged a wrong person,pratyush is taking ur doubt

You were replying really fast and I am stuck with backtracking part from the complete day so tagged you

@piyush.bansal8158625 You just need to generate the rightmost path. Please check your code. It is not giving the desired output even for the sample test case.
Please check this: