Ask HN: How to Approach Algorithm Studying?
I&#x27;m using leetcode.com to study algorithms and I&#x27;m finding I&#x27;m actually struggling on my first pass.<p>Generally, I can intuit the &quot;brute force&quot; solution, but the &quot;right&quot; answer with linear&#x2F;constant time often requires looking at the answer.<p>Should I expect that with practice, I&#x27;ll eventually get better at quickly finding the optimal solution?  Or, is it expected that optimal solutions are &quot;memorized&quot; similar to how hard sciences like ME &#x2F; EE &#x2F; CE memorize formulas?<p>Take ThreeSum problem for example.  I was able to write the brute force solution without any prior knowledge of the problem.  In an interview with time constraints this WOULD have been my solution.<p>I now understand that&#x27;s not the right solution.  I&#x27;ve looked at the answer, and I have the &quot;right&quot; solution memorized.  That kind of feels like cheating though  Should I have been able to write that &quot;right&quot; solution straight away, with no prior exposure to the problem?<p>Just trying to understand what my goal is in this process, and what is considered &quot;success&quot; for my studies.