Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created May 23, 2022 14:29
Embed
What would you like to do?
private static int SumOdd_BranchFree(int[] array)
{
int counter = 0;
for (int i = 0; i < array.Length; i++)
{
var element = array[i];
var odd = element & 1;
counter += (odd * element);
}
return counter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment