当前位置:网站首页>剑指 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;
}
};
边栏推荐
猜你喜欢

微信公众号服务器配置

【无标题】

How to view the change trend of cloud database from the behind of the launch of tidb to Alibaba cloud

Kalman Filter 遇到 Deep Learning : 卡尔曼滤波和深度学习有关的论文

2022-06-17 网工进阶(十)IS-IS-通用报头、邻接关系的建立、IIH报文、DIS与伪节点

How did I raise my salary to 20k in three years?

What processes are needed to build a wechat applet from scratch?

【 apprentissage automatique】 cas de prévision et d'analyse de l'examen d'entrée à l'Université basé sur des séries chronologiques multiples

Optimization of lazyagg query rewriting in parsing data warehouse

【效率】又一款笔记神器开源了!
随机推荐
2021, committed to better development
WPF development essays Collection - ECG curve drawing
20省市公布元宇宙路线图
Uncover ges super large scale graph computing engine hyg: Graph Segmentation
pytorch官方文档学习记录
The third day of mysql45
Read mysql45 - a simple understanding of global locks and table locks
Differences between et al and etc
Bypass technology to talk about 'cross end'
根据先序遍历和中序遍历生成后序遍历
1-8Vmware中的文件共享
Unity技术手册 - 干扰/噪音/杂波(Noise)子模块
八种button的hover效果
Day_ twelve
Day_ ten
The first day of reading mysql45
Notes: lbcf: a Large Scale budget Constrained causal Forest Algorithm
Common APIs and exception mechanisms
【剑指 Offer II 091. 粉刷房子】
2022-06-17 advanced network engineering (x) is-is-general header, establishment of adjacency relationship, IIH message, DIS and pseudo node