赞
踩
题目:
题解:
- func missingNumber(nums []int) int {
- n := len(nums)
- total := n * (n + 1) / 2
- arrSum := 0
- for _, num := range nums {
- arrSum += num
- }
- return total - arrSum
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。