Skip to content

Instantly share code, notes, and snippets.

@rudrankriyam
Created January 20, 2020 05:06
Show Gist options
  • Save rudrankriyam/47fdceb1a26895274c304f4a8dd832ee to your computer and use it in GitHub Desktop.
Save rudrankriyam/47fdceb1a26895274c304f4a8dd832ee to your computer and use it in GitHub Desktop.
Example for using remainder operator
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