Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set<Coordinate> within10k = new HashSet<>();
- for (int x = 0; x <= maxX; x++) {
- for (int y = 0; y <= maxY; y++) {
- int sum = 0;
- for (Coordinate c : coords) {
- sum += manhattanDistance(c, x, y);
- }
- if (sum < 10000) {
- within10k.add(new Coordinate(x, y));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment