Starting from the left side of an integer, adjacent digits pair up in "battle" and the larger digit wins. If two digits are the same, they both lose. A lone digit automatically wins.
Create a function that returns the victorious digits.
To illustrate:
battle_outcome(578921445) ➞ 7925
# [57]: 7 wins; [89] 9 wins; [21] 2 wins;
# [44] neither wins; 5 (automatically) wins
battle_outcome(32531) ➞ 351
# 3 deffeats 2, 5 defeats 3, 1 is a single.
battle_outcome(111) ➞ 1
# 1 and 1 tie, so neither move on, last 1 is a single.
battle_outcome(78925) ➞ 895