You are reading a single comment by @wence and its replies. Click here to read the full conversation.
  • Nice. I also split on \n\n and reverse the lines that denote the crates, and after that it's not so bad. islice would've been handy, I need to dig into that itertools library at some point (although probably only for AOC purposes!)

  • The thing to note is that the "stack" part of the input has trailing whitespace, so you can go from line-by-line based input to column-based input with zip(*stacks.split("\n")), then it's just a question of picking out the bits you need.

About

Avatar for wence @wence started