Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    Rust code does not take into account that Balzer starts from the last element.

    Modifying initial tests squad[0] = TRIGGER_STATE; to squad[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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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