What is the better approach for backtracking problems?

Hi!, I'm doing some backtracking problems and I got a doubt, what is the better approach between this two solutions, and if someone can help me with telling me the the difference between the two?

What I'm thinking is that in the second approach we decide to peak and not peak the element, that is why we use two recursive calls for visiting the two branches.

And on the first one i have some doubts but, we do the two things in the for.
Thank you for answering! :)

image
image

Comments (1)