leetcode
KatherineLeeyq
李雅琪是一只奋斗中的程序媛~
展开
-
【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原创 2016-04-18 03:30:36 · 375 阅读 · 0 评论 -
【Leetcode】1.Two Sum 解题
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution.原创 2016-04-15 23:36:21 · 299 阅读 · 0 评论 -
【Leetcode】3.Longest Substring Without Repeating Characters 解题
Given a string, find the length of the longest substring without repeating characters.Given “abcabcbb”, the answer is “abc”, which the length is 3. Given “bbbbb”, the answer is “原创 2016-04-16 01:06:37 · 340 阅读 · 0 评论 -
【LeetCode】4.Median of Two Sorted Arrays 解题
Median of Two Sorted ArraysThere 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)).原创 2016-04-18 00:16:26 · 266 阅读 · 0 评论 -
【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)原创 2016-04-18 02:04:00 · 340 阅读 · 0 评论 -
【Leetcode】7.Reverse Integer 解题
Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Have you thought about this?Here are some good questions to ask before coding.原创 2016-04-18 02:49:32 · 471 阅读 · 0 评论 -
【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.【我的思路】: 从string前部原创 2016-04-18 00:49:27 · 288 阅读 · 0 评论 -
【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 return it a原创 2016-04-15 23:45:43 · 319 阅读 · 0 评论 -
【Leetcode】9.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 converting the integer to string原创 2016-04-19 16:35:25 · 442 阅读 · 0 评论