In a case where at least two out of three booleans are true, this is the easiest way to find out:
BOOL a, b, c;
-(BOOL)checkAtLeastTwo
{
return a && (b || c) || (b && c);
}
What will be the optimal solution if there is ten booleans and at least two of them needs to be true? Thanks in advance.