题目:

题解:
class Solution {
    public int missingNumber(int[] nums) {
        int n = nums.length;
        int total = n * (n + 1) / 2;
        int arrSum = 0;
        for (int i = 0; i < n; i++) {
            arrSum += nums[i];
        }
        return total - arrSum;
    }
}![[排序]hoare快速排序](https://i-blog.csdnimg.cn/direct/250e6ee2b51e4ffb86c48f9818cfc186.png)


















