x was added to every price in the list before (x may be negative or zero). The result is the list after: the same prices after the change, possibly in a different order.
Two lists count as equal when they hold the same numbers with the same number of repeats, in any order.
Return x.before=[12, 5, 9], after=[7, 11, 14] → 2
Adding 2 to every price gives [14, 7, 11], the same numbers as in after, just in a different order.
before=[40, 30], after=[10, 20] → -20
Every value dropped by 20, so the answer is −20.
before=[6], after=[6] → 0
x is guaranteed to existbefore=[12, 5, 9], after=[7, 11, 14]
2
Run checks the first 3 tests in your browser. Submit checks all 97 tests on the server, hidden ones included.