Skip to content

Commit b5862d1

Browse files
authored
Create AVeryBigSum.swift
1 parent 42c2988 commit b5862d1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// https://www.hackerrank.com/challenges/a-very-big-sum/problem
2+
3+
import Foundation
4+
5+
// Complete the aVeryBigSum function below.
6+
func aVeryBigSum(ar: [Int]) -> Int {
7+
var result: Int = 0
8+
for i in ar {
9+
if (i <= 0) || (i >= 100000000000) {
10+
continue
11+
}
12+
result += i
13+
}
14+
return result
15+
}

0 commit comments

Comments
 (0)