Skip to content

Commit 86fe850

Browse files
committed
🟢 Solve problem 2703
1 parent a4ec118 commit 86fe850

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎swift/2703.swift‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
func argumentsLength(args: [Any?]) -> Int {
2+
return args.count
3+
}
4+
5+
let tests = [
6+
argumentsLength(args: [nil, "hello", 2]) == 3,
7+
argumentsLength(args: []) == 0,
8+
argumentsLength(args: [1, 2, 3, nil, 5]) == 5
9+
]
10+
11+
if tests.allSatisfy({ $0 == true }) {
12+
print("All tests passed")
13+
} else {
14+
print("Some tests failed")
15+
}

0 commit comments

Comments
 (0)