Advertisement
Guest User

Untitled

a guest
Dec 7th, 2024
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. loop {
  2. let next_op = match operators[i] {
  3. op if op == *operations.last().unwrap() => operations[0],
  4. _ => {
  5. operations[operations.iter().position(|&x| x == operators[i]).unwrap() + 1]
  6. }
  7. };
  8. operators[i] = next_op;
  9. if next_op != operations[0] {
  10. break;
  11. }
  12. if i == 0 {
  13. return 0;
  14. }
  15. i -= 1;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement