Search This Blog

Loading...

Wednesday, May 21, 2008

A Solution to Programming Job Interview Challenge 4

Here's the answer to this challenge:


static int Foo(int n)
{
return 10*(1-n/10)+n%10;
}


An even simpler solution would be:

static int Foo(int n)
{
return 24-n;
}

1 comment:

lotto said...

Nice blog. Thats all.