
LeetCode 268 Missing Number 题解
1.题目:
Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.
For example,
Given nums = [0, 1, 3] return 2.
题意:
如题所示找出缺失的那个数
2.解题思路:
3.代码
1 |
|

Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.
For example,
Given nums = [0, 1, 3] return 2.
题意:
如题所示找出缺失的那个数
1 |
|
近期评论