Issue
Hint:
The expression s.charAt(i) returns the character at position i of the string s.
Test:
String word = "Hello";
System.out.println("The word \""+word+"\" decomposes as "+Arrays.toString(decomposeString(word)));
Result:
The word "Hello" decomposes as [h, e, l, l, o]
Solution
You can use the .toCharArray()
method for this.
Example
String str = "Hello";
char[] ch = str.toCharArray();
Answered By - Tamas Szoke
Answer Checked By - David Goodson (JavaFixing Volunteer)