Skip to content

Commit d777bf1

Browse files
refactor 491
1 parent d759464 commit d777bf1

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
import java.util.List;
66
import java.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
public class _491 {
249

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

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy