- 博客(25)
- 收藏
- 关注
原创 07 整数反转
给你一个 32 位的有符号整数 x ,返回将 x 中的数字部分反转后的结果。如果反转后整数超过 32 位的有符号整数的范围[−231,231− 1] ,就返回 0。假设环境不允许存储 64 位整数(有符号或无符号)...
2022-07-10 16:12:28
118
原创 LeetCode第一题:给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
class Solution{ public: int lengthOfLongestSubstring(string s) { vector<int>twosum(vector<>&nums, int target) { vector<int>(-1, -2); //初始化 for (in...
2022-05-23 16:07:42
325
1
原创 LeetCode第三题:无重复字符的最长子串(C++)
class Solution{ public: int lengthOfLongestSubstring(String s) { Set<Character> hashSet = new HashSet<>(); //创建一个Set容器,HashSet是一个算法 //Set集合保证元素唯一 //右指针,不断添加 int right = -1; int ans = ...
2022-05-23 15:30:26
494
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人