Brain teaser: A more complicated way to negate integers
Today, we will look at a brain teaser: Design a function f() that operates on whole numbers, such that f(x) = y and f(y) = -x. Or, more succintly, f(f(x)) = -x. I will help you analyze the problem, and contribute my suggestion for a solution, along with an explanation of why it works. Spoiler […]
Recent Comments