![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
ice_camel
这个作者很懒,什么都没留下…
展开
-
#3 Longest Substring Without Repeating Characters
题目链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/Given a string, find the length of the longest substring without repeating characters. For example, the longest原创 2015-06-19 21:46:01 · 313 阅读 · 0 评论 -
#15 3Sum
题目链接:https://leetcode.com/problems/3sum/Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum o原创 2015-06-22 16:27:12 · 558 阅读 · 0 评论 -
#20 Valid Parentheses
题目链接:https://leetcode.com/problems/valid-parentheses/Given a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid.The brackets m原创 2015-07-14 14:54:57 · 484 阅读 · 0 评论 -
#17 Letter Combinations of a Phone Number
题目链接:https://leetcode.com/problems/letter-combinations-of-a-phone-number/Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to l原创 2015-07-14 08:30:32 · 601 阅读 · 0 评论 -
#18 4Sum
题目链接:https://leetcode.com/problems/4sum/依次将问题转化为3Sum、2Sum问题, 后两个问题解法见关联博文。/** * Return an array of arrays of size *returnSize. * Note: The returned array must be malloced, assume caller calls fr原创 2015-07-14 11:39:51 · 633 阅读 · 0 评论 -
#19 Remove Nth Node From End of List
题目链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list:原创 2015-07-14 12:43:38 · 572 阅读 · 0 评论 -
#21 Merge Two Sorted Lists
题目链接:https://leetcode.com/problems/merge-two-sorted-lists/Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two原创 2015-07-14 14:57:50 · 554 阅读 · 0 评论 -
#22 Generate Parentheses
题目链接:https://leetcode.com/problems/generate-parentheses/Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a原创 2015-07-14 16:41:36 · 571 阅读 · 0 评论 -
#23 Merge k Sorted Lists
题目链接:https://leetcode.com/problems/merge-k-sorted-lists/Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-l原创 2015-07-18 23:03:45 · 507 阅读 · 0 评论 -
#24 Swap Nodes in Pairs
题目链接:https://leetcode.com/problems/swap-nodes-in-pairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as原创 2015-07-18 23:08:57 · 413 阅读 · 0 评论 -
#26 Remove Duplicates from Sorted Array
题目链接:https://leetcode.com/problems/remove-duplicates-from-sorted-array/Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.原创 2015-07-19 17:04:28 · 550 阅读 · 0 评论 -
#27 Remove Element
题目链接:https://leetcode.com/problems/remove-element/Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed.原创 2015-07-19 17:13:21 · 577 阅读 · 0 评论 -
#29 Divide Two Integers
题目链接:https://leetcode.com/problems/divide-two-integers/Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.int divide(in原创 2015-07-19 22:53:41 · 506 阅读 · 0 评论 -
#16 3Sum Closest
题目链接:https://leetcode.com/problems/3sum-closest/Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three i原创 2015-06-22 16:52:23 · 576 阅读 · 0 评论 -
#1 Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe原创 2015-06-19 19:00:46 · 392 阅读 · 0 评论 -
#8 String to Integer (atoi)
题目链接:https://leetcode.com/problems/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, ple原创 2015-06-21 13:31:10 · 515 阅读 · 0 评论 -
#10 Regular Expression Match
题目链接:https://leetcode.com/problems/regular-expression-matching/Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more原创 2015-06-21 16:04:11 · 545 阅读 · 0 评论 -
#7 Reverse Integer
题目链接:https://leetcode.com/problems/reverse-integer/Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thou原创 2015-06-21 13:29:01 · 331 阅读 · 0 评论 -
#11 Container With Most Water
原题链接:https://leetcode.com/problems/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 draw原创 2015-06-21 18:24:27 · 427 阅读 · 0 评论 -
#6 ZigZag Conversion
原题链接:https://leetcode.com/problems/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 i原创 2015-06-21 13:25:35 · 579 阅读 · 0 评论 -
#12 Integer to Roman
题目链接:https://leetcode.com/problems/integer-to-roman/Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.char* intToRoman(int原创 2015-06-21 21:20:36 · 399 阅读 · 0 评论 -
#4 Median of Two Sorted Arrays
题目链接:https://leetcode.com/problems/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 r原创 2015-06-20 11:12:26 · 334 阅读 · 0 评论 -
#2 Add Two Numbers
题目链接:https://leetcode.com/problems/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 contai原创 2015-06-19 19:08:55 · 451 阅读 · 0 评论 -
#5 Longest Palindromic Substring
原题链接:https://leetcode.com/problems/longest-palindromic-substring/Given a string S, find the longest palindromic substring inS. You may assume that the maximum length of S is 1000, and ther原创 2015-06-21 12:55:10 · 480 阅读 · 0 评论 -
#9 Palindrome Number
题目链接:https://leetcode.com/problems/palindrome-number/Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative inte原创 2015-06-21 13:48:11 · 544 阅读 · 0 评论 -
#13 Roman to Integer
题目链接:https://leetcode.com/problems/roman-to-integer/Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.int Digit(char ch) {原创 2015-06-21 21:22:28 · 385 阅读 · 0 评论 -
#14 Longest Common Prefix
题目链接:https://leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings.char* longestCommonPrefix(char** strs, int原创 2015-06-21 21:50:02 · 415 阅读 · 0 评论 -
#28 Implement strStr()
题目链接:https://leetcode.com/problems/implement-strstr/Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update原创 2015-07-19 19:31:57 · 383 阅读 · 0 评论