An array of 100 elements contains values ranging from 0 to 100, inclusive. Determine which value is missing.
Sigiloso
Ok here's my algorithm. Loop though the array, keep updating the sum of indices (indSum += i) and the sum of values at these indices (valSum += a[i]). once the loop ends, add i (ie 100) to indSum. Now ( indSum - valSum ) will give you the answer. TIme Complexity O(n)