We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49b6585 commit d9f2cc3Copy full SHA for d9f2cc3
missing-number/yhkee0404.scala
@@ -1,5 +1,5 @@
1
object Solution {
2
def missingNumber(nums: Array[Int]): Int = {
3
- (1 to nums.length).reduce(_ ^ _) ^ nums.reduce(_ ^ _)
+ (1 to nums.length).reduce(_ ^ _) ^ nums.reduce(_ ^ _) // T(n) = O(n), S(n) = O(1)
4
}
5
0 commit comments