tterrag1098

Untitled

Dec 5th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Set<Coordinate> within10k = new HashSet<>();
  2. for (int x = 0; x <= maxX; x++) {
  3. for (int y = 0; y <= maxY; y++) {
  4. int sum = 0;
  5. for (Coordinate c : coords) {
  6. sum += manhattanDistance(c, x, y);
  7. }
  8. if (sum < 10000) {
  9. within10k.add(new Coordinate(x, y));
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment