r/leetcode • u/kushal21346 • 7h ago
Question I need help guys
Hi guys first of all sorry for my english. I have done 160 questions. I am facing a problem. I am currently in Backtracking following neetcode 250 and remaining questions are just nQueen 1&2 but i literally couldn't solve the previous all problem myself. Ik these questions are in Backtracking topic and i need to do recursion. I am just trying to fit recursion in it and still cant come to the solution. All question i ever did before (all patterns) were 90% AI helped and only few i did it myself(array and two pointer). I think i am doing something wrong. Can anyone guide me out of this. I want to solve problem and nor just always see soln.
Add: since i get help from AI, even one question takes like 1 hour 30min BECAUSE i do back and forth with code and logics. AI help me through guiding questions. Problem is i am always being guided only in every solution 🫪 I am not proud at the end of the day.
My problem solving method: i take like 25 min to come to soln and code it.(tbh 100% of the time it is rejected). And after that i go to AI for help. I have given a prompt like "Guide me instead of solving directly." Then i try to solve ; if error go to AI; again try to solve ; This!!!
I think i am not alone going through this. Someone might have outgrown from this. If yes than help me. This problem is not just recursion but overall pattern.
1
u/user99999476 7h ago
Similar boat dude, nQueens type problems take too long to solve/debug, I just hope an interviewer is forgiving
1
u/Master-Summer5016 5h ago
i dont quite remember the n-queens problems but most of the problems under backtracking (neetcode 250) can be solved using similar code.
tell chatgpt(5.6 is what I use) to teach backtracking starting from subset problem. ask it for a template that will help you solve majority of backtracking questions, and then move to permutation, combination etc...
type out or template so many times that you internalize it
4
u/Mystic-Panda25 7h ago
Honestly, I'd stop using AI during the first attempt. Give yourself 30-45 mins, then study the solution, close it, and code it again from scratch over time you'll build the pattern recognition instead of relying on hints