Created
January 20, 2020 05:06
-
-
Save rudrankriyam/47fdceb1a26895274c304f4a8dd832ee to your computer and use it in GitHub Desktop.
Example for using remainder operator
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
func findNumbers(_ nums: [Int]) -> Int { | |
var count = 0 | |
for value in nums { | |
var number = String(value) | |
if number.count % 2 == 0 { | |
count += 1 | |
} | |
} | |
return count | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment