Skip to content

Commit

Permalink
Day 14 - String II
Browse files Browse the repository at this point in the history
  • Loading branch information
xckomorebi committed Aug 29, 2022
1 parent 6555f27 commit 1050af6
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions StringII.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.*;

public class StringII {
public static void main(String[] args) {
StringII s = new StringII();
Expand Down Expand Up @@ -54,10 +56,10 @@ public String reverseWords(String input) {
}

/**
* Right Shift By N Characters
* <p>
* Right shift a given string by n characters.
*/
* Right Shift By N Characters
* <p>
* Right shift a given string by n characters.
*/
public String rightShift(String input, int n) {
if (n == 0 || input.isEmpty()) {
return input;
Expand All @@ -66,4 +68,16 @@ public String rightShift(String input, int n) {
char[] ch = input.toCharArray();
return new String(ch, n, ch.length - n) + new String(ch, 0, n);
}

/**
* All Permutations II
* <p>
* Given a string with possible duplicate characters, return a list with all
* permutations of the characters.
*/
public List<String> permutations(String input) {
List<String> result = new ArrayList<>();

return result;
}
}

0 comments on commit 1050af6

Please sign in to comment.