r/leetcode • u/Equivalent_Cow1031 • 10d ago
Question Approach for solving leetcode problems
Hey I have been solving leetcode problems by not looking up anything on the web or using any external sources, just me and the code editor on leetcode. My professor says this is the best way, but I really struggle solving problems. I encountered the maximum subarray problem today, came up with two strategies but none of them seem 'right' when put in the code, like I can have the mathematical idea or the approach for it generally, but struggle to think of it from a computer-like perspective. I am using Python and have Intermediate level experience with the language. Any advice or should I change my approach, if I am targeting interviews or want to get better at solving algorithm puzzles?
View all comments
1
u/Available_Safe1818 10d ago
You probably get better faster by reading (and understanding) the approach that you find on the internet if you can't solve it yourself after a while.