Seitz.Will
BAN USER
Comments (3)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
How can you use count sort? There are O(k^n) possibilities (k being alphabet size) for the strings. Count sort is based on mapping values to small integers. I don't see how you can possibly do that.
- Seitz.Will September 16, 2014Comment hidden because of low score. Click to expand.
-1
of 3 vote
a = [1,5]; b = [5,9]; c = [1,5]
Your algorithm returns the min as 4 when it is actually 0.
The algorithm sorting b and c and searching for the closest element within to every a also fails on:
a = [3,6]; b = [1,9]; c = [5,9]
This algorithm will return the min of 8 when the answer is 6.
- Seitz.Will September 04, 2014Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
I think you are making an assumption that there are 10^6 numbers. The problem does not state this. The problem states the numbers are in a range from 1 to 10^6. If you are making an assumption that each number shows up once then the problem is trivial (9*10^5).
- Seitz.Will October 17, 2014