摘要:https://oj.leetcode.com/problems/generate-parentheses/Given n pairs of parentheses, write a function to generate all combinations of well-formed paren...
阅读全文
随笔分类 - LeetCode
摘要:https://oj.leetcode.com/problems/valid-parentheses/ Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the in
阅读全文
摘要:https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/ Given a digit string, return all possible letter combinations that the number
阅读全文
摘要:https://oj.leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings.解题思路:这题属于...
阅读全文
摘要:https://oj.leetcode.com/problems/palindrome-number/Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.So...
阅读全文
摘要:https://oj.leetcode.com/problems/4sum/Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplet...
阅读全文
摘要:https://oj.leetcode.com/problems/3sum-closest/Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, targe...
阅读全文
摘要:https://oj.leetcode.com/problems/3sum/Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array w...
阅读全文
摘要:https://oj.leetcode.com/problems/rotate-list/Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->...
阅读全文
摘要:https://oj.leetcode.com/problems/implement-strstr/Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle ...
阅读全文
摘要:https://oj.leetcode.com/problems/valid-palindrome/Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignori...
阅读全文
摘要:https://oj.leetcode.com/problems/partition-list/Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater...
阅读全文
摘要:https://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/Given a linked list, remove thenthnode from the end of list and return its head.For ...
阅读全文
摘要:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?...
阅读全文
摘要:https://oj.leetcode.com/problems/linked-list-cycle-ii/Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Fo...
阅读全文
摘要:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/Given a sorted array, remove the duplicates in place such that each element appea...
阅读全文
摘要:https://oj.leetcode.com/problems/sort-colors/Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are a...
阅读全文
摘要:https://oj.leetcode.com/problems/container-with-most-water/ Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinat
阅读全文
摘要:https://oj.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 ...
阅读全文
摘要:https://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->...
阅读全文

浙公网安备 33010602011771号