0
How to write possible strings formed by using the characters 'c', 'a', 't', 'd', 'o', and 'g' exactly once.
I'm new to this, please help me 😞
3 odpowiedzi
+ 2
Airose P. Abel
Make a character array and using new String (char[] a) convert it into string like this
char[] arr = {'a', 'b', 'c'};
String str = new String (arr);
System.out.println(str);
0
Looks like you want to generate the permutations https://en.wikipedia.org/wiki/Permutation
This tutorial explains implementation in java
https://www.baeldung.com/java-array-permutations
0
You can also use toString(char) method