![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
狗仔小分队
这个作者很懒,什么都没留下…
展开
-
LeetCode 6. ZigZag Conversion
AC : 20ms 按照顺序填充 string,除了第一行和最后一行以外,都需要额外添加斜向上的一个字符 class Solution { public: string convert(string s, int numRows) { if (numRows==1) return s; int len=s.length(); st原创 2016-04-05 14:29:00 · 220 阅读 · 0 评论 -
LeetCode 7. Reverse Integer
AC : 20ms 给出的几个思考问题很好,最后一位是0该如何处理,翻转超限该怎么处理? 最终的代码: class Solution { public: int reverse(int x) { long long ans=0; for(;x!=0;x/=10) ans=ans*10+x%10; re原创 2016-04-06 09:57:13 · 243 阅读 · 0 评论