How to solve using LL?

I have solved this problem using backtracking but cant decide what is the role of linked list in this problem ?

hey @prajwalbakshi, there is no role of Linked list, this question can be done using backtracing as well as DP. I think it is placed in Linked list section by mistake.

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.