Skip to content

Commit

Permalink
changed combinationString to ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
rotatingcow committed Dec 24, 2022
1 parent af4e240 commit 32bb776
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Main {

static int combinationsInt = 0;
static String combinationsString = "";
static ArrayList<String> combinationsString = new ArrayList<String>();

public static void main(String[] args) {

Expand All @@ -23,11 +23,12 @@ public Main(){
private void scrambleWord(String str, int l, int r){

if (l == r){

if(!combinationsString.contains(str)){
System.out.println(str);
combinationsInt += 1;
combinationsString += str;
}
combinationsString.add(str);
}

}else {
for (int i = l; i <= r; i++) {
Expand Down

0 comments on commit 32bb776

Please sign in to comment.