Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I've removed the second loop now and used a stack for matching brackets and still timing out. Any tips?
I'm struggling now, the tests pass and they pass quite quickly but when I attempt it times out.
The only loops in my solution are the main program loop and something that does bracket matching so I'm assuming that it's a large program that has lots of [ ]
This comment is hidden because it contains spoiler information about the solution
I feel the same about the C# version. I'm not sure when the program is supposed to exit. It passes some tests if it exists when it's processed all the input but not others.
I'm only doing Rust Katas because I've never used it before. It's nice to say why you think iterators are no good here, otherwise you're sort of trolling.
I somewhat agree although there's a solution below that just uses new lines a little more effectively with the same methods that I think is easier to read.
There's not really "a lot" of code here. Best practice really should be about the code having clear intent and no major performance issues. I don't rate the solution that's been most rated as "best practice" as best practice at all, it iterates the input twice and is all on a single line. This is clear and only iterates once.