0
Anyone here familiar with Advent of code
Just need help with some puzzles
18 Antworten
+ 3
Alex When am solving these puzzles, i always store the input in a file and then read the data, reshape it and use it but with this puzzle my usual way was broken and i tried using numpy to reshape the data but failed. So you are free to solve your way. Or you can just reshape the data and i will do the rest.
+ 3
I made a code setup in case anyone else would like to solve the puzzle:
https://code.sololearn.com/cvMp4QRylj8p/?ref=app
+ 2
boards = np.array_split(dataset, dataset.size / 5)
Don't know how you named your variables. Dataset is the cleaned list and boards the grouped lines
Let me know if this works. I rarely use python
+ 2
Alex finally done. I need to take nap.
+ 1
Where do you need help?
I think I can help you.
+ 1
+ 1
Part 1 or 2?
+ 1
l0ckD2wN here is the input https://adventofcode.com/2021/day/4/input
+ 1
Could you tell us the individual steps with which you wanted to solve the task? Or do you have a particular step you are struggling with?
+ 1
Ash, give it a try.
+ 1
Ash Try day1
+ 1
Alex i already did all that and got the list. What i wanna know is how can i group each 5 rows separatelty?
+ 1
Alex it has worked,thanks alot.
+ 1
Congrats! Part 2 after your nap ^^
0
Part 1, I guess. Is there any input given?
0
So you have problems handling the dataset. I don't want to give a whole solution (I'd need to write it in python first ^^), but maybe I can you by describing how I parsed the inputfile.
1. read file as a string array of lines
2. parse the first line into an integer array (these are used to run the bingo game loop after parsing the boards)
3. remove the first line and all empty lines
What's now being left is a clean list of bingo board rows. Each 5 rows are 1 board.
Hope this helps you a bit. Have fun and just ask if something isn't clear.
0
Alex am done with both parts,
0
looks interesting
how does this look?
https://code.sololearn.com/cnGtm7D8akrM/?ref=app