So, I’m currently at day 5, can I just hardcord the inputs only for stacks? :sweat_smile: Parsing th...
d
So, I’m currently at day 5, can I just hardcord the inputs only for stacks? πŸ˜… Parsing the input seems to be a nightmare πŸ‘» Edit: I parsed it
yes black 2
p
s/nightmare/fun
x
I found a fun way to do it. Basically you index where each numeral appear on line number 9 and use that indexes on the lines 8 β†’ 0
c
It's not as hard as it looks: the box numbers are always in the same position, and are either a character or a space.
Just ignore the ascii-art parts and focus on what the data you need is and where it is
j
In AoC you can hardcode whatever you need if parsing turns out too time consuming for you. However, as mentioned above, the parsing is not that complicated in the end... πŸ˜‰
d
Thanks a lot good people. I went the nightmare way (fun way 😜) and finally solved the problem It’s not an ideal way but it works πŸ‘ Here is my solution: https://github.com/mddanishansari/advent-of-code-2022/commit/b73e09c6a5bebfacd4b177f495062e3288a3de54
For Day 05 actual solution was not that difficult but parsing the input itself was quite difficult.
j
yes, sometimes the input parsing needs more code than actual solution πŸ€·β€β™‚οΈ