Light Mode
Dark Mode
total < 0?!

The preconditions say:

the second argument is between -1000 and 1000.

If no one complains, I'll create a pull request that demands `0 <= total < 1000`

Outside of check.io a way to give negative values a meaningful meaning might be:
check that "removing -2 items" and then "removing +2 items" yields in the original set.
Something like: "remove_min_max( remove_min_max(data, - postotal), postotal) == data" for any postotal > 0

P.S.:
I wonder if there are other ideas how to deal with negative values besides the trivial solution "tread them like 0"

Created: Feb. 26, 2023, 11:54 a.m.
Updated: Feb. 27, 2023, 9:16 a.m.
1
25
User avatar
mu_py