题目: Write a function to find the longest common prefix string amongst an array of strings. 求一系列字符串的公共字符串前缀。 题目…
标签:LeetCode题目解答汇总
LeetCode | Letter Combinations of a Phone Number(号码的字符串组合)
Given a digit string, return all possible letter combinations that the number could represent. A mapping of di…
LeetCode | Valid Parentheses(括号匹配)
Given a string containing just the characters '(', ')', '{', '}', '[' and '…
LeetCode | Remove Nth Node From End of List(移除链表中倒数第n个结点)
题目: Given a linked list, remove the nth node from the end of list and return its head. For example, …
LeetCode | Generate Parentheses(生成括号)
Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthes…
LeetCode | Merge k Sorted Lists(归并k个链表)
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 将…
LeetCode | Remove Duplicates from Sorted Array(删除有序数组的重复元素)
Given a sorted array, remove the duplicates in place such that each element appear only once and ret…
LeetCode | Swap Nodes in Pairs(将链表中的元素两两交换)
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3-…
LeetCode | Remove Element(删除指定元素)
Given an array and a value, remove all instances of that value in place and return the new length. The order o…
LeetCode | Search for a Range(查找数据出现的范围)
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorith…
LeetCode | Search Insert Position(查找插入位置)
Given a sorted array and a target value, return the index if the target is found. If not, return the index whe…
LeetCode | Next Permutation(下一个排列)
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of nu…