Skip to content

Commit 49b6585

Browse files
authored
missing number solution
1 parent 69660f2 commit 49b6585

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

missing-number/yhkee0404.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object Solution {
2+
def missingNumber(nums: Array[Int]): Int = {
3+
(1 to nums.length).reduce(_ ^ _) ^ nums.reduce(_ ^ _)
4+
}
5+
}

0 commit comments

Comments
 (0)