没有合适的资源?快使用搜索试试~ 我知道了~
leetcode:每日LeetCode记录
需积分: 5 0 下载量 48 浏览量
2021-05-01
22:46:15
上传
评论
收藏 251KB ZIP 举报
温馨提示
LeetCode记录 大批 先锋和法 给定一个整数数组nums ,编写一个返回该数组“ pivot”索引的方法。 我们将枢轴索引定义为索引,其中索引左侧的数字总和等于索引右侧的数字总和。 如果不存在这样的索引,则应返回-1。 如果有多个枢轴索引,则应返回最左侧的枢轴索引。 范例1: Input: nums = [1, 7, 3, 6, 5, 6] Output: 3 Explanation: The sum of the numbers to the left of index 3 (nums[3] = 6) is equal to the sum of numbers to the right of index 3. Also, 3 is the first index where this occurs. 范例2: Input: nums = [1, 2, 3] Out
资源推荐
资源评论
资源评论
孙洋Sonya
- 粉丝: 23
- 资源: 4634
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功