There are two types of potions:
"A""B""A" immediately follows a digit, add 1 to the digit."B" immediately follows a digit, subtract 1 from the digit.Create a function that returns a string according to these rules, removing the potions once they've been consumed.
afterPotion("3A78B51") ➞ "47751"
// 3 grows to 4, 8 shrinks to 7
afterPotion("9999B") ➞ "9998"
afterPotion("9A123") ➞ "10123"
afterPotion("567") ➞ "567"