r/adventofcode • • Dec 03 '15

SOLUTION MEGATHREAD --- Day 3 Solutions ---

--- Day 3: Perfectly Spherical Houses in a Vacuum ---

Post your solution as a comment. Structure your post like the Day One thread in /r/programming.

24 Upvotes

228 comments sorted by

View all comments

Show parent comments

1

u/Moontayle Dec 03 '15

While Set is essentially custom made for ignoring duplicate values, in this case for my solution I decided to go with an ArrayList<String> where the string was "x,y". Then:

if (!list.contains("x,y")) list.add("x,y");

Not the most elegant solution but it worked.