LeetCode
liliechao
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
7. Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Note: The input is assumed to be a 32-bit signed integer. Your func原创 2017-05-25 21:23:52 · 224 阅读 · 0 评论 -
5. Longest Palindromic Substring
自己写的代码: 参照了: http://blog.youkuaiyun.com/hopeztm/article/details/7932245public char[] preProcess(String s){ int n = s.length(); if(n == 0){ char[] ch1 = new char[2]; c原创 2017-05-25 20:44:40 · 246 阅读 · 0 评论 -
6. ZigZag Conversion
public class Solution { public String convert(String s, int numRows) { if(numRows == 1) return s; int len = s.length(), k = 0, interval = (numRows<<1)-2; char[]原创 2017-05-25 21:20:58 · 302 阅读 · 0 评论 -
8. String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible i原创 2017-05-26 01:46:23 · 240 阅读 · 0 评论 -
LeetCode前3题
Two Sumpublic static int[] twoSum(int[] numbers, int target) { int[] result = new int[2]; Map<Integer, Integer> map = new HashMap<Integer, Integer>(); for (int i = 0; i < number原创 2017-05-25 21:15:02 · 257 阅读 · 0 评论 -
9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of原创 2017-05-26 04:01:37 · 286 阅读 · 0 评论
分享