这些找missing number的题是不是都不能用求和做?# JobHunting - 待字闺中
Z*Z
1 楼
# Given an array of size n. It contains numbers in the range 1 to n. Each
number is present at least once except for 1 number. Find the missing number.
# Given an array of size n. It contains numbers in the range 1 to n. Each nu
mber is present at least once except for 2 numbers. Find the missing numbers
.
# Given an array of size n. It contains numbers in the range 1 to n. Find th
e numbers which aren’t present.
优化空间的话就sort;否则就开一个size 为N的array,是不?
number is present at least once except for 1 number. Find the missing number.
# Given an array of size n. It contains numbers in the range 1 to n. Each nu
mber is present at least once except for 2 numbers. Find the missing numbers
.
# Given an array of size n. It contains numbers in the range 1 to n. Find th
e numbers which aren’t present.
优化空间的话就sort;否则就开一个size 为N的array,是不?