会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Figure at a Window
管理
上一页
1
2
3
4
2022年3月21日
LeetCode 7. 整数反转
摘要: 题意 整数反转, 即个位变最高位, 最高位变个位; 同时, 翻转后溢出则不考虑 模拟样例 123 > 321 2147483647 --> 0; 翻转后溢出了 代码 class Solution { public: int reverse(int x) { int ans = 0; while (x
阅读全文
posted @ 2022-03-21 21:53 Figure_at_a_Window
阅读(26)
评论(0)
推荐(0)
2022年1月31日
LeetCode 5994. 查找给定哈希值的子串
摘要: 题意 使用指定的hash函数,返回给定字符串s第一个长度为k的hash值 = 给定hashVal的子串的下标。 方法 hashNew=val(s[first])+power∗(hashNow−val(s[last])∗power^(k−1) 代码 class Solution { public: i
阅读全文
posted @ 2022-01-31 22:57 Figure_at_a_Window
阅读(40)
评论(0)
推荐(0)
上一页
1
2
3
4