Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -0,0 +1,16 @@
|
|||
public class NonContinuousSubsequences {
|
||||
|
||||
public static void main(String args[]) {
|
||||
seqR("1234", "", 0, 0);
|
||||
}
|
||||
|
||||
private static void seqR(String s, String c, int i, int added) {
|
||||
if (i == s.length()) {
|
||||
if (c.trim().length() > added)
|
||||
System.out.println(c);
|
||||
} else {
|
||||
seqR(s, c + s.charAt(i), i + 1, added + 1);
|
||||
seqR(s, c + ' ', i + 1, added);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue