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.
In the part where you reverse the words (
for(int j=words[i].length();j>=0;j--)
), the indexj
goes out of bounds. The correct range should be fromwords[i].length() - 1
down to0
.You're appending characters to the
word
variable, but you're not pushing it to thecut_string
vector correctly. The word is only added tocut_string
when a space is encountered, but this doesn't properly handle the last word in the string if there's no trailing space.OP solved it, closing
It would also be more correct since
pow
returns adouble
, which gets imprecise atn = 94906269
.i love it
Scrutinized tests
Added useful assertion messages
Added input and returned types
Removed reference solution and made it differ from author's solution
Added corresponding headers to be compatible with PHPUnit 9.5.2
Scrutinized tests
Added useful assertion messages
Added input and returned types
Removed reference solution
Added corresponding headers to be compatible with PHPUnit 9.5.2
Scrutinized tests
Added useful assertion messages
Added input and returned types
Removed reference solution and made it differ from author's solution
Added corresponding headers to be compatible with PHPUnit 9.5.2
Scrutinized tests
Added useful assertion messages
Added returned types
Removed reference solution
Added corresponding headers to be compatible with PHPUnit 9.5.2
Scrutinized tests
Added useful assertion messages
Removed reference solution
Added corresponding headers to be compatible with PHPUnit 9.5.2
Scrutinized tests
Added useful assertion messages
Removed reference solution
Added corresponding headers to be compatible with PHPUnit 9.5.2
Scrutinized tests
Added useful assertion messages
Input mutation is no longer possible
Added corresponding headers to be compatible with PHPUnit 9.5.2
kata hint != kata suggestion
OP solved it, closing
Scrutinized tests
Made a shallow copy of array to prevent input mutation
Added useful assertion messages
Added input and returned types
Added corresponding headers to be compatible with PHPUnit 9.5.2
Loading more items...