会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
KyrieLiu
博客园
首页
新随笔
联系
订阅
管理
2021年5月27日
LeetCode 1.两数之和
摘要: 解法一:暴力求解 分析: 直接两层循环,遍历数组: 第一层循环确定一个数n1,然后第二层循环中判断数组中是否存在target - n1,如果存在,将{n1,n2}返回。 O(n^2),会超时。 代码: vector<int> twoSum_force(vector<int>& nums, int t
阅读全文
posted @ 2021-05-27 09:48 KyrieLiu
阅读(108)
评论(0)
推荐(0)
公告