Created
July 17, 2020 20:08
-
-
Save JohnMGant/445a7676e20731525b168e2f7185c4e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| internal class EnumeratorAdder : IIntegerAdder | |
| { | |
| public int Add(int[] values) | |
| { | |
| IEnumerator<int> enumerator = values.AsEnumerable().GetEnumerator(); | |
| int sum = 0; | |
| while (enumerator.MoveNext()) | |
| { | |
| sum += enumerator.Current; | |
| } | |
| return sum; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment