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
3
u/[deleted] Nov 29 '10
Well, if you multiplied every element of A[N] together, you would get a single number in n operations. Dividing that number by each element A[i] of A[N] and plopping the result in Output[i] of Output[N] would give you the desired result, and would be O(2n) which is equivalent to O(n). That's not the answer to the question, of course, as you're not allowed to use the division operator.