hj
BAN USER
Comments (6)
Reputation 0
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.
0
of 0 vote
@logicfinder - this doesnt work. what if k = 6 and the array looks like:
111100
000110
000010
000001, from your logic the minimum number required will be 6 (by xor-ing 1st, 3rd & 4th). But the correct answer is 2 (1st and 2nd), which when xor-ed will return 111010 (only 4)
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.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
@Varun - yes, what if k = 2 and there are two closest stars whose relative distance is smaller than their respective distance from the centroid. In short, the centroid need not always be a part of the set of 'k' closest stars.
- hj July 31, 2013