Archive for category: Programming

Brain teaser: A more complicated way to negate integers

25 Jun
2013-06-25

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 […]

© Copyright - Christian Iversen's blog
UA-41598088-1