Skip to content

Commit 09b421b

Browse files
authored
Update and rename Solution.swift to Solution2.swift
1 parent abc2486 commit 09b421b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lcci/17.04.Missing Number/Solution.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
func missingNumber(_ nums: [Int]) -> Int {
3+
let n = nums.count
4+
return n * (n + 1) / 2 - nums.reduce(0, +)
5+
}
6+
}

0 commit comments

Comments
 (0)