https://kotlinlang.org logo
#advent-of-code
Title
# advent-of-code
a

adamratzman

12/04/2020, 5:33 AM
You just have to split the input by \n\n, and split each of those by space or newline
d

David Whittaker

12/04/2020, 5:34 AM
Good idea! I'll keep that in mind for next time.
a

adamratzman

12/04/2020, 5:34 AM
Thanks! Forgot that you can provide multiple delimeters to split
d

David Whittaker

12/04/2020, 5:35 AM
I split on ":" and " " -- didn't think about \n\n
a

adamratzman

12/04/2020, 5:35 AM
Still a good move!
I was just trying to figure out a way to differentiate between passports
And realized that even if there was a newline, there wouldn’t be two newlines in a row
d

David Whittaker

12/04/2020, 5:36 AM
totally makes sense now - good thinking!
❤️ 1
4 Views