Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    That indeed seems simpler. My code produces output in lexicographic order, while this approach doesn't, but most use cases won't care about that. (I wasn't deliberately going for that when I wrote my code.) Commented Apr 17, 2025 at 7:53
  • @user2357112 Yeah I had thought about which would be preferable, but didn't come to a conclusion. Anyway, added another solution with start fixed instead. Commented Apr 17, 2025 at 8:15
  • Thanks for the help. Yes order is important for later steps. only really for tracing back over method. Commented Apr 19, 2025 at 0:18