Skip to content

Commit c4d0a06

Browse files
committed
feat: Add solution for LeetCode problem 268
1 parent 488a909 commit c4d0a06

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

missing-number/WhiteHyun.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// 268. Missing Number
3+
// https://leetcode.com/problems/missing-number/description/
4+
// Dale-Study
5+
//
6+
// Created by WhiteHyun on 2024/05/19.
7+
//
8+
9+
final class Solution {
10+
func missingNumber(_ nums: [Int]) -> Int {
11+
(0 ... nums.count).reduce(0, +) - nums.reduce(0, +)
12+
}
13+
}

0 commit comments

Comments
 (0)