this is the link to my code, only one testcase passes.
Please help me rectify the error
Only 1 test case passes
Here is your corrected code. You have to print -1 when no solution exists. And for the first rightmost path, you just return true if rightc is true. I made the changes. Please check it.