Skip to content

Commit 4414248

Browse files
committed
Add Solution.java for 0268.Missing Number
1 parent a62ae44 commit 4414248

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution {
2+
public int missingNumber(int[] nums) {
3+
int res = nums.length;
4+
for(int i = 0; i < nums.length; i++){
5+
res += i - nums[i];
6+
}
7+
return res;
8+
}
9+
}

0 commit comments

Comments
 (0)