http://www.dev102.com/2008/05/19/a-programming-job-interview-challenge-4/
How would you implement the following method: Foo(7) = 17 and Foo(17) = 7. Any other input to that method is not defined so you can return anything you want. Just follow those rules:
- Conditional statements (if, switch, …) are not allowed.
- Usage of containers (hash tables, arrays, …) are not allowed.
public int Foo(int x){
return 22^x;
}
No comments:
Post a Comment