without using any conditional statements like if,for,while etc..
you are allowed to you any operators like &, |, ^ etc...
your function can use return statement.
int Ternary(int a, int b, int c)
{
return (a&b)|(!a&c);
}
DFS the life without backtracking
int Ternary(int a, int b, int c)
{
return (a&b)|(!a&c);
}
No comments:
Post a Comment