Yes, I'd considered using return value. I can't remember if there was a good reason not to use it. I think I should use it to handle both the current -1 and -2 cases.

The previous implementation broke with duplicates. If forcing `sum_duplicates` isn't unreasonable overhead, then sure we can do it. But I think it's also fair to leave that responsibility to the user and mention `sum_duplicates` in the error message.