摘要:
题目:Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique p... 阅读全文
摘要:
题目: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],... 阅读全文
摘要:
题目:Given a collection of integers that might contain duplicates,nums, return all possible subsets.Note:Elements in a subset must be in non-descending ... 阅读全文
摘要:
题目:Given a set of distinct integers,nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must ... 阅读全文
摘要:
题目:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted fro... 阅读全文
摘要:
题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in... 阅读全文
摘要:
题目: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 ... 阅读全文
摘要:
题目:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,... 阅读全文
摘要:
题目:Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should... 阅读全文
摘要:
题目:Sort a linked list inO(nlogn) time using constant space complexity.代码:/** * Definition for singly-linked list. * struct ListNode { * int val; *... 阅读全文