4 ms·Proved only for non-negative numbers! :)by smitherfield 10y agoProved only for non-negative numbers! :)mrkgnao 10y agoUse the absolute value, maybe? You might have duplicates, but both n and -n can be special :)