The nested iteration does not allow for depend loops. I believe the rationale behind that is that the nested iteration yields an rectangular Array which is not guaranteed if the loops’ lengths can depend on each other.
Here are some other suggestions:
eachline(file) |> stack |> permutedims
permutedims(stack(eachline(file))) # same as above, just different syntax
stack(eachline(file); dims=1)
If you want to save time and the file is formatted cleanly as in the question, using mmap will probably be fastest. Also note the use of UInt8 instead of Char, as Char is really a 32-bit Unicode point, but UInt8 is appropriate for old style ASCII only files.
here another reference to the AOC 2024 context/contest.
Refer to the ZULIP blog.
I would have liked to see the discussions about AOC problems here instead.
I tried my hand at the problem of day 4, I had a lot of difficulty even simply activating the spoiler of my proposed solutions.