3 ms·
> For the most problems, there actually can be multiple ways to solve the same problem, with each approach having both hard (perf, memory) and soft (simplicity)
by the_only_law 5y ago
> For the most problems, there actually can be multiple ways to solve the same problem, with each approach having both hard (perf, memory) and soft (simplicity) trade offs.
True, but my understanding is in interviews, which is the context most people are interacting with leetcode, the interviewer is looking for only one of those answers, and you have to regurgitate the right one fast.
- deleted 5y ago[deleted]
- boopboopbadoop 5y agoAs someone that does interviewing, I am not looking for one specific “right” answer. Acknowledging the time constraint and pressure of an interview, I find it acceptable to get non-optimal solutions. As long as they’re able to come up with a reasonable solution and can recognize it as being non-optimal, and offer ideas for how to optimize it outside of an interview setting. I’m not sure how common this way of thinking is, but I wanted to point it out since many of the comments here make it sound like only the best answer will do.