Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loop {
- let next_op = match operators[i] {
- op if op == *operations.last().unwrap() => operations[0],
- _ => {
- operations[operations.iter().position(|&x| x == operators[i]).unwrap() + 1]
- }
- };
- operators[i] = next_op;
- if next_op != operations[0] {
- break;
- }
- if i == 0 {
- return 0;
- }
- i -= 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement