Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func solution(_ num: Int) -> Int {
- var result:Int = 0
- if num >= 3 {
- for i in (3...num - 1) {
- if (i % 3 == 0 || i % 5 == 0) { result += i}
- }
- }
- return result
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement