Missing Number
Given an array containingndistinct numbers taken from0, 1, 2, ..., n
, find the one that is missing from the array.
Example
Example 1:
Example 2:
Note
找0到N-1可以使用求和法
Code
Last updated
Given an array containingndistinct numbers taken from0, 1, 2, ..., n
, find the one that is missing from the array.
Example 1:
Example 2:
找0到N-1可以使用求和法
Last updated