Description
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
Example:
1 | Input: [1,1,2] |
Difficulty: Medium
Code:
1 | class Solution { |
题意
给定一组可能包含重复数字的集合,返回所以不重复的全排列。
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
Example:
1 | Input: [1,1,2] |
Difficulty: Medium
Code:
1 | class Solution { |
给定一组可能包含重复数字的集合,返回所以不重复的全排列。
Given a collection of distinct integers, return all possible permutations.
Example:
1 | Input: [1,2,3] |
Difficulty: Medium
Code:
1 | class Solution { |
给定一系列非重复数字,返回全排列。
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Your goal is to reach the last index in the minimum number of jumps.
Example:
1 | Input: [2,3,1,1,4] |
Note:
You can assume that you can always reach the last index.
Difficulty: Hard
Code:
1 | class Solution { |
给定一个正数数组,初始化时指向数组的第一个元素,每个元素的值表示在这个位置上能向前跳的最大长度。
目标是跳动到最后一个元素,并且用到步数最少,并返回最少步数。假定一定能够到达最后一个元素。
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for ‘?’ and ‘*’.
1 | '?' Matches any single character. |
The matching should cover the entire input string (not partial).
Note:
Example 1:
1 | Input: |
Example 2:
1 | Input: |
Example 3:
1 | Input: |
Example 4:
1 | Input: |
Example 5:
1 | Input: |
Difficulty: Hard
Code:
1 | class Solution { |
给定一个字符串s和模式p,实现通配符匹配,支持?和。?表示任意一个字符,表示任何字符串。
匹配是完全匹配,s可能为空或者只包含a-z,p可能为空或者包含a-z和?或*。
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.
Example 1:
1 | Input: num1 = "2", num2 = "3" |
Example 2:
1 | Input: num1 = "123", num2 = "456" |
Note:
Difficulty: Medium
Code:
1 | class Solution { |
给定两个代表非负num1和num2的字符串,用字符串表示它们的乘积。字符串的长度小于110,只包含0-9。不能将输入转成int进行计算。