Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    expected:<emocleW[]> but was:<emocleW[ ]>
    I don't have ideas what's this problem is about?

    public class SpinWords {

    public String spinWords(String sentence) {
        String[] str = sentence.split(" ");
        String result = "";
        for(int i = 0; i<str.length;i++){
            if(str[i].length()>=5){
                result+=new StringBuilder(str[i]).reverse().toString()+" ";
            }
            else{
                result+=str[i]+" ";
            }
        }
        return result.trim()+" ";
    }
    

    }

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution