3 ms·
I wonder if this would be faster on average (most numbers fail all five comparisons) for #2? int y = x ^ (x-1); return x == y * (y+1) / 2 && ([comparison lis
by scythe 7y ago
I wonder if this would be faster on average (most numbers fail all five comparisons) for #2?
int y = x ^ (x-1);
return x == y * (y+1) / 2 && ([comparison list]);