Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd777bf1

Browse files
refactor 491
1 parentd759464 commitd777bf1

File tree

1 file changed

+1
-16
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-16
lines changed

‎src/main/java/com/fishercoder/solutions/_491.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@
55
importjava.util.List;
66
importjava.util.Set;
77

8-
/**
9-
* 491. Increasing Subsequences
10-
*
11-
* Given an integer array, your task is to find all the different possible increasing subsequences of the given array,
12-
* and the length of an increasing subsequence should be at least 2 .
13-
14-
Example:
15-
Input: [4, 6, 7, 7]
16-
Output: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]]
17-
18-
Note:
19-
The length of the given array will not exceed 15.
20-
The range of integer in the given array is [-100,100].
21-
The given array may contain duplicates, and two equal integers should also be considered as a special case of increasing sequence.
22-
*/
238
publicclass_491 {
249

2510
publicstaticclassSolution1 {
@@ -33,7 +18,7 @@ public List<List<Integer>> findSubsequences(int[] nums) {
3318
}
3419

3520
privateSet<List<Integer>>backtracking(int[]nums,intstart,List<Integer>currList,
36-
Set<List<Integer>>answer) {
21+
Set<List<Integer>>answer) {
3722
if (currList.size() >=2) {
3823
answer.add(newArrayList<>(currList));
3924
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp