当前位置:网站首页>LeetCode练习2——两数之和
LeetCode练习2——两数之和
2022-07-27 17:30:00 【却道天凉_好个秋】
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;
}边栏推荐
- In a real case, college students were cheated when taking orders. I hope you won't be cheated [painful lesson]
- AcWing 692. G巴士计数 差分+前缀和
- ACL11.12
- C#网络应用编程,实验2:IP地址转换和域名解析练习
- 强化学习介绍
- Marqueetextview (running lantern)
- Normalization and standardization
- New library online | cnopendata detailed address data of all patents in China
- Online Judge 输出超限
- C191: password compilation
猜你喜欢

Togglebutton (button switch)

JS event listening mouse keyboard form page onclick onkeydown onchange

VLAN test 2021.1.14

Sword finger offer 25. merge two sorted linked lists

Gesturedetector (gesture recognition)

连接池-归还连接详解(上)

如何运行 kevinchappell / formBuilder

C background GC cause and effect

Version announcement | Apache Doris 1.1 release version officially released!

统一建模语言 (UML) 规范
随机推荐
全局函数
C243:考试排名
NAT 11.16
Capacitance in series and in parallel and capacitance in series and balance resistance
sqlite创建表联合主键的sql写法
JS find all nodes sibling childNodes children
Built in module 10.18
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte
Hacker introductory tutorial (very detailed) from zero basic introduction to proficiency, it is enough to read this one.
C#网络应用编程,实验一:WPF练习
ViewUI 中 DatePicker 日期选择器在 IE11 浏览器中兼容解决方案
Gestureoverlayview (gesture recognition 2)
11.2DHCP
ms721负载测试
探索新一代活动获客方式,虚拟化活动棋胜一招 | 厂商征集
C background GC cause and effect
聊聊 Redis 是如何进行请求处理
被动收入:回归原始且安全的两种赚取方法
Program design Comprehensive Experiment III
Marqueetextview (running lantern)