Your solution to also include the last character if the string has uneven length seems like a big hack and should be avoided. Also substring is waaaay slower than charAt('last index')
This might look friendly, but it is unecessary and might lead to caching problems. You cant have the complete String in memory so you should go once from the beginning till the end. And use modulo to determine even and uneven.
Good Solution, but if the first word have more uppercase letter el resulte is diferente to camelCase. ie: "thE-stealth-warrior" not return "theStealthSarrior"
I'm passing the random tests, but the example and fixed tests both return runtime errors. Even if I just make the function return true, is still gives errors. Has anyone had similar problems? I'm using Java.
simple, and straightforward
This comment is hidden because it contains spoiler information about the solution
Not a kata issue. Your solution fails for cases like
ae
orAu
. Re-read the descriptionThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
nice solution bro! mine was the worse i've saw. hahahahahha
For j+=1 just write j++
Your solution to also include the last character if the string has uneven length seems like a big hack and should be avoided. Also substring is waaaay slower than charAt('last index')
Small suggestion:
for(int j=1; j<out.length(); j+=2) temp+=out.charAt(j);
for(int j=0; j<out.length(); j+=2) temp+=out.charAt(j);
This might look friendly, but it is unecessary and might lead to caching problems. You cant have the complete String in memory so you should go once from the beginning till the end. And use modulo to determine even and uneven.
This comment is hidden because it contains spoiler information about the solution
most simple
Good Solution, but if the first word have more uppercase letter el resulte is diferente to camelCase. ie: "thE-stealth-warrior" not return "theStealthSarrior"
This comment is hidden because it contains spoiler information about the solution
I'm passing the random tests, but the example and fixed tests both return runtime errors. Even if I just make the function return true, is still gives errors. Has anyone had similar problems? I'm using Java.
Wow, a lot of these solutions are unecessarily complicated. You don't need to use StringBuilder at all.
Loading more items...