当前位置:网站首页>Leetcode exercise 2 - sum of two numbers
Leetcode exercise 2 - sum of two numbers
2022-07-27 20:08:00 【But the sky is cold_ Good autumn】
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> vec;
int size = nums.size();
for(int i = 0; i < size; i++)
{
for(int j = i + 1; j < size; j++)
{
if(nums[i] + nums[j] == target)
{
vec.push_back(i);
vec.push_back(j);
break;
}
}
}
return vec;
}边栏推荐
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte
- No experts! Growth secrets for junior and intermediate programmers and "quasi programmers" who are still practicing in Universities
- Capacitance in series and in parallel and capacitance in series and balance resistance
- [Redis] Redis穿透、雪崩和击穿
- Can go to QQ but can't open the web page
- 2022爱分析·智慧社区厂商全景报告 厂商征集
- 探索新一代活动获客方式,虚拟化活动棋胜一招 | 厂商征集
- [redis] several deployment methods of redis
- C191: password compilation
- 程序设计综合实验三
猜你喜欢
![[openbmc series] 4. Start the process and use qume to simulate ast2600 EVB](/img/ab/026111b25836758ec7ffec8d60f49d.png)
[openbmc series] 4. Start the process and use qume to simulate ast2600 EVB

Common errors reported by pytorch

Rodin 安装 SMT Solvers 插件

JS实现视频录制-以Cesium为例

Hacker introductory tutorial (very detailed) from zero basic introduction to proficiency, it is enough to read this one.

邬贺铨:因地制宜 数字化技术赋能“双碳”实践

如何运行 kevinchappell / formBuilder

化工巨头巴斯夫&Pasqal:利用量子神经网络优化天气预报

2022爱分析·智慧社区厂商全景报告 厂商征集

Understanding of basic concepts of channel capacity and channel bandwidth
随机推荐
PC博物馆(3) MITS Altair 8800
Dcm11- write the function and configuration of the data service ($2e) according to the identifier [based on DaVinci configurator classic]
Ms721 load test
[C # network application programming] Experiment 3: process management exercise
PMP每日一练 | 考试不迷路-7.27(包含敏捷+多选)
【PyTorch系列】PyTorch之torchvision 图像处理库详解
Sword finger offer 25. merge two sorted linked lists
C#网络应用编程,实验一:WPF练习
总线Bus是什么意思
成年人只有一份主业是要付出代价的,被人事劝退后,我哭了一整晚
TS2532: Object is possibly ‘undefined‘
What does bus mean
C191: password compilation
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte
codeforces每日5题(均1500)-第二十四天
An in-depth understanding of crystal oscillation circuit derived from xtalin pin and xtalout pin of single chip microcomputer
静态试验。2021.01 .13
Introduction to reinforcement learning
How powerful can top "hackers" be? Internet access without signal, expert: high-end operation!
统一建模语言 (UML) 规范