Ad
  • Default User Avatar

    I guess because of this condition "The input array should not be modified!"

  • Default User Avatar

    bruh, why is everyone making a copy of the array ????

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks for your comment. As you see the string is converted to lowercase at the start and since vanilla java doesn't have pythons zip() it starts with an IntStream range() to determine wether the current character is in an odd or even position - eda so after that I had to deal with upper and lower case separately (my goal was to put the whole solution into one statement)..nsi

  • Custom User Avatar

    Nice, but it could be shorter - you could convert the string from start to lowercase, and handle in map() only the case for lowercase (as initial case doesn't matter, anyway, in the end). And converting the even positioned chars in uppercase at the end seems a stretch done like this (instead of using Character.toLowerCase())