On one test case where answer should be 17, my code return 7. Isn’t that the optimal answer?
PS: I have done it with plain DFS, no backtracking because I don’t understand why we need it over here.
Please help. Thankyou!
On one test case where answer should be 17, my code return 7. Isn’t that the optimal answer?
PS: I have done it with plain DFS, no backtracking because I don’t understand why we need it over here.
Please help. Thankyou!