Code link : https://ide.codingblocks.com/s/437913
It is failing for last test case but why?
hello @deep4013
see ur logic is bit wrong.
u r considering strings that are formed only by single type of step (ie u r forming string either diagnollay , vertically or horizontally )
but u r never considering cases where we have more than one type of step ( like some steps diagonally and then horizontally )
hint -> use recursion
Ok I would try that way.
Close this doubt too.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.