当前位置:网站首页>剑指 Offer II 012. 左右两边子数组的和相等
剑指 Offer II 012. 左右两边子数组的和相等
2022-06-25 16:35:00 【Python ml】
class Solution {
public:
int pivotIndex(vector<int>& nums) {
int total=accumulate(nums.begin(),nums.end(),0);
int sum=0;
for(int i=0;i<nums.size();++i){
if(2*sum+nums[i]==total)
return i;
sum+=nums[i];
}
return -1;
}
};
边栏推荐
- Ncnn source code learning collection
- WPF development essays Collection - ECG curve drawing
- The problem of missing precision of kettle table input components
- Paper notes: lbcf: a large scale budget constrained causal forest algorithm
- Mysql database multi table query
- Bombard the headquarters. Don't let a UI framework destroy you
- 一个 TDD 示例
- 千万级购物车系统缓存架构方案
- Kettle表输入组件精度丢失的问题
- XShell连接VMWare虚拟机
猜你喜欢
Optimization of lazyagg query rewriting in parsing data warehouse
Xinlou: Huawei's seven-year building journey of sports health
Wireshark网卡无法找到或没有显示的问题
内卷?泡沫?变革?十个问题直击“元宇宙”核心困惑丨《问Ta-王雷元宇宙时间》精华实录...
2022-06-17 网工进阶(十)IS-IS-通用报头、邻接关系的建立、IIH报文、DIS与伪节点
What processes are needed to build a wechat applet from scratch?
【NLP】今年英语高考,CMU用重构预训练交出134高分,大幅超越GPT3
1-8file sharing in VMWare
Tensorflow old version
Redis series - overview day1-1
随机推荐
Final, override, polymorphic, abstract, interface
MySQL_ JDBC
3. conditional probability and independence
Differences between et al and etc
ncnn源码学习全集
Mac PHP multi version management and swoole extension installation
Day_ 04
千万级购物车系统缓存架构方案
AD域登录验证
Bypass technology to talk about 'cross end'
Effects and laws
20省市公布元宇宙路线图
Ad domain login authentication
Day21 multithreading
深入理解和把握数字经济的基本特征
Read mysql45 the next day
DDD概念复杂难懂,实际落地如何设计代码实现模型?
Kalman time series prediction
Wechat official account server configuration
Unity技术手册 - 生命周期旋转RotationOverLifetime-速度旋转RotationBySpeed-外力ExternalForces