Do you really try to solve each LC problem before looking at the solution?

Oct 19, 2018 4 Comments

Everything I read says to struggle through a medium problem before peeking at the solution. Do you do this for every problem?

154 PARTICIPANTS SELECT ONLY ONE ANSWER
VOTE VIEW RESULT

comments

Want to comment? LOG IN or SIGN UP
TOP 4 Comments
  • Google
    Noogler69

    Go to company page Google

    Noogler69
    Do you get to peek at the solution before writing code in an interview? You need to practice under the same conditions you interview in. The goal is to eliminate the anxiety that comes from being presented with a problem and having to quickly write working code for it. Looking at the solution first does not help you do that.
    Oct 19, 2018 1
  • AppDynamics / Ops
    k2k2

    Go to company page AppDynamics Ops

    PRE
    IBM, Pegasystems, Cisco, Google
    BIO
    Gangnam Style
    k2k2
    I work slightly differently, out of the box thinking, I look at the answer and try and work out the question. Actually that’s not true, I always work out the question, no trying about it. As Yoda said “Do. Or do not. There is no try.”, he was also the first to say “Do you even Leetcode bro?” But that got cut from the movie after a row between George Lucas and Mark Hamill over where to put starting curly brackets. True story.
    Oct 20, 2018 0
  • I'll attempt the problem, if I'm totally stuck I'll look at just the titles in discussions and usually that'll give me enough of a hint to get started. Then I'll watch or read some tutorials on that topic. This usually gets me a working solution. Then I look at the solution to learn the clever tricks to get an optimal solution.
    Oct 19, 2018 0