一、原题 Given a collection of numbers, return all possible permutations.  For example,  [1,2,3] have the following permutations:  [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].  一、中文 返回一个数组的所有

LeetCode   java  

一、原题 The count-and-say sequence is the sequence of integers beginning as follows:  1, 11, 21, 1211, 111221, ...  1 is read off as "one 1" or 11.  11 is read off as "two 1s" or 21.  21 is read off as "

LeetCode   java  

一、原题 Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.  The Sudoku board could be partially filled, where empty cells are filled with the character '.'.     A partially filled

LeetCode   java   时间复杂度   排序算法   logN  

一、原题 Given a sorted array of integers, find the starting and ending position of a given target value.  Your algorithm’s runtime complexity must be in the order of O(log n).  If the target is not found

LeetCode   java   时间复杂度   logN  

一、原题 Divide two integers without using multiplication, division and mod operator.  If it is overflow, return MAX_INT.  一、中文 不使用除法,乘法和取余,求两个整数的相除的结果,如果有溢出就返回最大的整数。  三、举例   给定一个被除数20,给定一个除数3,最后得到的结果是6 四

LeetCode   java  

一、原题 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. It doesn’t matter what you leave beyond the new length. 

java   LeetCode   数组中重复元素  

一、原题   Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.    Do not allocate extra space for another array, you must do this in pla

LeetCode  

一、原题 Given 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 2->1->4->3.    Your algorithm should use only constant s

LeetCode   链表   相邻元素交换  

一、原题 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 lists.  二、中文 合并两个排序链表并返回一个新的列表。新的链表的结果由原先的两个链表结点组成,也就是不能合并后的

LeetCode   链表合并  

一、原题 Given a string containing just the characters '(',  ')',  '{',  '}',  '[' and  ']', determine if the input string is valid.  The brackets must close in the correct order, “()” and “()[]{}” are al

java   LeetCode   字符串匹配  
1 2