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.
The description should disclose number of tests: 30 tests up to 1000 soldiers each. This would allow to deduct that any
HashMap
solution will likely not pass.Rust code does not take into account that Balzer starts from the last element.
Modifying initial tests
squad[0] = TRIGGER_STATE;
tosquad[size-1] = TRIGGER_STATE;
does not help, because the final tests have it hard-coded as well.The same problem may exist in other translations.
This comment is hidden because it contains spoiler information about the solution
Not enough information and available information scattered everywhere. You say the first few robots will have an updated state and transition_rule will be used to update the states of all robots. The rest is left to assumption from the description. Confirming a state for the previous robot and returning that clearly isn't enough and there's nothing else to gather from the description. Find a finite set of states and transition rules? We're only given 3 optional states, immutable in Rust.
What I'm taking away from 80% of the description with the other 20% left up in the air is that this function is called over a collection of robots and the return value is what the target robot's new state is, with all robots being the correct state expected