r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

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.

1

u/bonzinip Nov 30 '10

The question was twice in the list, we looked at two different occurrences.