Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created May 23, 2022 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/64d3888b24f3183678cf9fe753b0ae59 to your computer and use it in GitHub Desktop.
Save lgolubyev/64d3888b24f3183678cf9fe753b0ae59 to your computer and use it in GitHub Desktop.
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