Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yes
I think this is a more realistic approach since getting what is false first would reduce nesting.
You are given an integer as a parameter input, not a string. Strings have a 'replace' prototype but integers don't. Therefore when you try to access the 'replace' prototype, you recieve an error because it doesn't exist. Cast the integer to a string. Also, make sure you return an integer instead of a string as well.
Codewars bug. Just click the "Unlock solutions" button since you would've already been rewarded honor and language ranking xp. It shouldn't change anything.
str[i] = str[i]*str[i]; looks incorrect as well. You are squaring a character with ASCII values between 48 and 58. Since 48 * 48 > 255, the answer placed into that character spot in the string would be unusable. Likewise, changing the characters to their integer value wouldn't be sufficient since the square of numbers greater then 3 would need two characters to be correctly represented in the string.
Why does my solution not show up after I submit it? And when I view solution it says I did not complete the challenge when clearly I solved this problem.