@@ -0,0 +1,648 @@
+/**%0A * Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, %0A * find the one that is missing from the array.%0A *%0A * The trick is to find the ideal sum if the missing number is included.%0A * This can be found in constant time because if the array contains all numbers from 0 - n,%0A * then the sum is just n * (n + 1) / 2.%0A * The missing number is then just the difference between the ideal sum and the actual sum.%0A */%0Apublic class Solution %7B%0A  public int missingNumber(int%5B%5D nums) %7B%0A    int n = nums.length;%0A    int sum = ((n) * (n + 1))/ 2;%0A    int current = 0;%0A    for (int i : nums) current += i;%0A    return sum - current;%0A  %7D%0A%7D%0A

add 268