Each day is it's own folder, each folder is it's own go program.
If you want to run a day's code, run go run .
from within the day's folder.
Just a quick package slapped together that'll help the repeated actions of pulling in and parsing the input files every day. May be added to over the course of the month. Yes I confuse array and slice terminology a lot, sue me.
Not good, not clean, not efficient, just getting the job done. Rampant copy and pasting from stackoverflow.
ReadIntArrayByLine(filepath)
spits out a slice of ints after splitting a file by lineReadStrArrayByLine(filepath)
spits out a slice of strings after splitting a file by lineStrToCharArray(string)
spits out a slice of single character "strings" from a provided stringStrToWordArray(string)
spits out a slice of words after splitting a string by spaces(" ")
SliceContains(slice, string)
simple loop to see if a string is an entry in a sliceRemoveFromStringSlice(slice, position)
removes the indicated position from a slice of strings, I think?IntArrayToString(intslice)
outputs a single string interpretation of an integer sliceCharArrayToIntArray(strslice)
outputs a integer array from a array of "strings" that are numbersIntToIntArray(int)
takes a single number and cuts it up into single digit integers in a slice
<stack>.IsEmpty()
Returns bool true if a stack is empty; false if not<stack>.Push(string)
Pushes a string into the top of the stack<stack>.Pop()
Pops the top value of the stack out. Returns the object and true if an object is successfully popped; An empty string and false if the stack was empty