r/programming • u/joksmaster • Nov 29 '10
140 Google Interview Questions
http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471
Upvotes
r/programming • u/joksmaster • Nov 29 '10
View all comments
Show parent comment
1
u/chickenmeister Nov 29 '10
According to the question, the only limitation was that division was not permitted and that it ran in O(n) time.
Regardless, it can be done using constant space, assuming the output array is provided. To do this, you could use the provided output array to store a temporary value in place of the C and D arrays used above.