Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [1 6 9 4 6 9 7 6 4 4 9 8 7]
- [1 → 6 → 9 ← 4 6 → 9 ← 7 ← 6 ← 4 4 → 9 ← 8 ← 7]
- [20 32 28]
- Input => [10 15 20 10 20 10 10]
- [10 → 15 → 20 10 20 ← 10 10]
- Output => [45 10 30 10]
- Input => [9 9 9 9 8 1 8]
- [9 9 9 9 ← 8 1 8]
- Output => [9 9 9 17 1 8]
- Input => [1 6 9 4 6 9 7 6 4 4 9 8 7]
- [1 → 6 → 9 ← 4 6 → 9 ← 7 ← 6 ← 4 4 → 9 ← 8 ← 7]
- Output => [20 32 28]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement