my solution
What is wrong in my approch ,althought i got the backtracking approach given in hint?
@chhabrapiyush480 hey,you have not used backtracking here therefore your code give wrong answer ,as after visiting particular index than calling recursion,than after completion of recursion you have to make visited of current index again zero as it will be non visited for another recursion call.
Hope you get it .Feel free to ask any doubt 
i dont think there is any need of backtracking here,according to me we will get the same result with my solution as well ,can you tell me a test case where my approach fails,thatcan make me understand why we need backtracking here?
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.