Ad
  • Custom User Avatar

    Well, as @Chrono79 said. You're using the same length as the previous string to make the array for the new string. So, on index 0 and last index are filled with blank values and automatically converted into a space by String. So, you should set the char array length to the previous string length minus 2 (Since we're removing two chars). After that, you need to handle the assignment in the loop.

    Good luck.

  • Custom User Avatar

    @zr.hossain
    img

    See carefully, there is space in your answer. So, no. It's not the same.

  • Custom User Avatar

    Your code is wrong, not a kata issue. If it has two chars less, why do you use the same length?