LeetCode-Java
way菜畦
步履蹒跚、跌跌撞撞
展开
-
LeetCode【3】.Longest Substring Without Repeating Characters--算法图解及java实现
第三道题Longest Substring Without Repeating Characters如下: public class Solution { public int lengthOfLongestSubstring(String s) { HashMap hs = new HashMap(); int maxl = 0;原创 2015-05-28 08:11:16 · 1525 阅读 · 1 评论 -
LeetCode【6】. ZigZag Conversion --思路图解与java实现
ZigZag Conversion一、题目如下: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for b原创 2015-06-04 00:01:22 · 2085 阅读 · 0 评论 -
LeetCode【5】. Longest Palindromic Substring --思路图解与java实现
Java Longest Palindromic Substring(最长回文字符串)原创 2015-06-02 00:22:51 · 3443 阅读 · 1 评论 -
LeetCode【4】. Median of Two Sorted Arrays --思路图解与java的不同方法实现
Median of Two Sorted Arrays 这道题确实有点难,想挺久,看别人答案也是不能一下子就明白。题目难度为Hard,原题如下:There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted原创 2015-05-29 08:02:31 · 2590 阅读 · 0 评论 -
LeetCode【7】.Reverse Integer--java实现
Reverse Integer题目要求:给定一个int 类型值,求值的反转,如下: Example1: x = 123, return 321 Example2: x = -123, return -321 简单问题一般蕴含细节的处理。思路很简单,直接贴Java程序:public class Solution { public int r原创 2015-06-05 00:04:09 · 2639 阅读 · 0 评论 -
LeetCode【8】. String to Integer (atoi) --java实现
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 you原创 2015-06-07 01:40:58 · 2056 阅读 · 0 评论 -
LeetCode【9】. Palindrome Number --java的实现
Palindrome Number Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of conver原创 2015-06-10 22:51:32 · 2171 阅读 · 3 评论 -
LeetCode【1】. Two Sum--java的不同方法实现
LeetCode 最近才知道有这么好的平台可以刷题,真是惭愧惭愧。现在开始,努力,一道道地刷题!原创 2015-05-22 01:12:25 · 3417 阅读 · 0 评论 -
* LeetCode【2】. Add Two Numbers--java实现
第二道题Add Two Numbers 如下: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a singl原创 2015-05-23 08:16:48 · 2597 阅读 · 0 评论