I'm about to start college and I'm considering diving into Leetcode problems to get a better grasp on Data Structures and Algorithms (DSA). However, I find that even the easy problems can take me up to two hours to solve, which has me wondering if I should focus on something else first. Would it be better to read a book on DSA to understand the concepts or maybe explore different platforms before tackling Leetcode? What's the right approach here?
2 Answers
Leetcode problems can feel more like puzzles rather than actual software development tasks. If you're just starting, it might be better to wait until after your DSA class. Learning the fundamentals first could really help you later on!
If you're struggling with easy problems taking over an hour, it might mean you need to solidify your understanding of the concepts. Take some time to learn the relevant topics first. Once you have a good grasp, checking the editorial solutions can also be helpful if you're really stuck.
I've just started learning about binary search and some other data structures, but I still find myself resorting to brute force for simple questions. It feels tough to come up with algorithms on my own.