Created
May 23, 2022 14:29
-
-
Save lgolubyev/64d3888b24f3183678cf9fe753b0ae59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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