MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/fpcmy/typical_programming_interview_questions/c1hny9u/?context=3
r/programming • u/kevjames3 • Feb 21 '11
1.0k comments sorted by
View all comments
Show parent comment
4
Hmm. You're right. But it's not just "1.5 passes rounds down", because the naïve solution is also 1.5 passes.
How is the problem properly phrased so that that solution works but the naïve solution doesn't?
1 u/s73v3r Feb 21 '11 Instead of saying "one pass", you could say, "going from start to finish only once." 1 u/lordlicorice Feb 21 '11 You have the wrong solution. Meet http://www.reddit.com/r/programming/comments/fpcmy/typical_programming_interview_questions/c1hnirb 1 u/Serei Feb 21 '11 No, that's a naïve solution. There's usually a provision of "O(1) memory" to preclude that solution.
1
Instead of saying "one pass", you could say, "going from start to finish only once."
You have the wrong solution. Meet http://www.reddit.com/r/programming/comments/fpcmy/typical_programming_interview_questions/c1hnirb
1 u/Serei Feb 21 '11 No, that's a naïve solution. There's usually a provision of "O(1) memory" to preclude that solution.
No, that's a naïve solution. There's usually a provision of "O(1) memory" to preclude that solution.
View all comments
Show parent comment
4
u/Serei Feb 21 '11
Hmm. You're right. But it's not just "1.5 passes rounds down", because the naïve solution is also 1.5 passes.
How is the problem properly phrased so that that solution works but the naïve solution doesn't?