Jay
BAN USER
Comments (9)
Reputation 40
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
I just think of a way.
in C++, there is a "set" container.
it will only store unique value.
So go along the array and insert value into the container, with complexity O(n).
compare the size of this container and original array.
if they are the same, there are no duplicate.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
use matrix and it's just one step calculation.
- Jay November 07, 2013But over the phone. Could be a nightmare