r/adventofcode • • Dec 06 '15

SOLUTION MEGATHREAD --- Day 6 Solutions ---

--- Day 6: Probably a Fire Hazard ---

Post your solution as a comment. Structure your post like the Day Five thread.

22 Upvotes

171 comments sorted by

View all comments

Show parent comment

1

u/thommath Dec 06 '15

I only have a beginners course in java, but I have programmed a lot by myself. I did almost the same as you only I used Scanner instead of BufferedReader and tested the words in your stringSplit instead of substring.

One last thing you can imrove is when you count ut the brightnessCount you don't want to type in 1000 as the limit. You either want to use array.length if you need the counter or simply use a for each loop.

for(int i : array){...}