#268. Missing Number 题目链接
public class Solution {
public int missingNumber(int[] nums) {
int sum = 0;
int sum2 = 0;
for (int i = 0; i < nums.length; i++) {
sum += i;
sum2 += nums[i];
}
sum += nums.length;
return sum - sum2;
}
}