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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
MohamDah, your code fails with small random tests too, so you can debug it. Here is an example:
Your code returns 29 instead of 28.
Same dude. I've spent more than 3 hours trying to get past that final one. The worst is that it doesn't even tell me why it's failing.
Why do I forget about regex?
Not a kata suggestion. See https://docs.codewars.com/training/troubleshooting#post-discourse.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
They should include in the description:
"brackets must be closed in the order they were opened"
Otherwise, test case #4 " "[(])" => False" is valid
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
This comment is hidden because it contains spoiler information about the solution
kata hint != kata suggestion
intersting kata, use Array's function , string => array => string
Loading more items...