嗯,这个班好像还蛮好的。# Love - 情爱幽幽
r*e
1 楼
first round phone interview with Amazon with an India. Got rejected. share
the questions which hopes other people
Questions 1: ( I am not sure if I misunderstand his question but I share
what I know) Given n Integer numbers, all of the numbers except one occur
twice and only one occur once. Find it.
Solution 1: Sort the array and loop and find it. time O(nlgn), space O(1)
Solution 2: using hashtable, time O(n), space O(n)
And then, he said what about numbers can occur more than twice or
the questions which hopes other people
Questions 1: ( I am not sure if I misunderstand his question but I share
what I know) Given n Integer numbers, all of the numbers except one occur
twice and only one occur once. Find it.
Solution 1: Sort the array and loop and find it. time O(nlgn), space O(1)
Solution 2: using hashtable, time O(n), space O(n)
And then, he said what about numbers can occur more than twice or