knowledgezenforyou@gmail.com
Assorted posts about Software design, development and debugging, algorithms and data structures, programming languages(C,C++,Python,Matlab,Javascript,...), programming puzzles,brain teasers and other technical stuff we find interesting.
Wednesday, 17 July 2013
My solution to the puzzle posted here few days back is below.
Implement a function h(n) as below:
h(h(n)) = -n
static int run = 0
int f(n)
{
run++;
return (pow(-1,(run-1))*n);
No comments:
Post a Comment