You are viewing a single comment's thread. Return to all comments →
C#:
public static int hackerlandRadioTransmitters(List<int> x, int k) { x.Sort(); int index = 0; int count = 0; while(index < x.Count){ int house = x[index]; while(index < x.Count && (x[index] - house) <= k){ index++; } house = x[index-1]; while(index < x.Count && (x[index] - house) <= k){ index++; } count++; } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Hackerland Radio Transmitters
You are viewing a single comment's thread. Return to all comments →
C#: