- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 leetcode 12. Integer to Roman
//Given an integer, convert it to a roman numeral. //Input is guaranteed to be within the range from 1 to 3999. //【罗马数字】 //1~9: {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}; //10~90: {
2016-04-29 14:41:47 248
原创 leetcode 11. Container With Most Water
//Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). //n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). //F
2016-04-29 14:25:04 184
原创 leetcode 10. Regular Expression Matching
//Implement regular expression matching with support for '.' and '*'. //'.' Matches any single character. //'*' Matches zero or more of the preceding element. //The matching should cover the entire i
2016-04-28 16:16:07 313
原创 leetcode 9. Palindrome Number
Solution1 //Determine whether an integer is a palindrome. //Do this without extra space. public class Solution { public static void main(String[] args) { int a = 1234321; boolean result = is
2016-04-28 10:27:10 277
原创 leetcode 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 inpu
2016-04-23 09:22:59 353
原创 leetcode 7. Reverse Integer
//Reverse digits of an integer. //Example1: x = 123, return 321 //Example2: x = -123, return -321 public class Solution { public static void main(String[] args) { int a = 100; int result =
2016-04-22 17:04:25 286
原创 leetcode 6. 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 better legibility) //P A H N //A P
2016-04-22 16:11:53 254
原创 leetcode 5. Longest Palindromic Substring
//Given a string S, find the longest palindromic substring in S. //You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. public class Solut
2016-04-22 08:47:01 364
原创 leetcode 4. Median of Two Sorted Arrays
//There are two sorted arrays nums1 and nums2 of size m and n respectively. //Find the median of the two sorted arrays. //The overall run time complexity should be O(log (m+n)). public class Solut
2016-04-21 16:19:56 261
原创 leetcode 3. Longest Substring Without Repeating Characters
//Given a string, find the length of the longest substring without repeating characters. //Examples: //Given "abcabcbb", the answer is "abc", which the length is 3. //Given "bbbbb", the answer is "b",
2016-04-21 09:34:36 299
原创 leetcode 1. two sum
public class Solution { public int[] twoSum(int[] nums, int target) { for(int i = 0;i for(int j = i+1;j if(nums[i]+nums[j] == target){ int[] a = {i,j}; return a;
2016-04-21 07:31:05 204
原创 leetcode 2. 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 single digit. //Add the two numbers and retu
2016-04-20 14:46:16 188
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人