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
same for me in python
edit: my fault. you should return the position!
the answer should be -1 because there is no bigger number than 84 possible with the two digits 8 & 4
just add year + 1 at the beginning to make sure it's at least 1 year after
This comment is hidden because it contains spoiler information about the solution
Also, I have no idea what you second
if
statement is about.Your whole approach seems to be prone to errors, I'd actually recommend coming back to this one after solving more katas first. Also, when you post code, use proper code formatting, and read this troubleshooting FAQ first.
Literally the first example...
Your code would return False. Your code just removes the asterisk, but it can be replaced with any other string to match the strings, if possible.
"You will be given two strings a and b consisting of lower case letters, but a will have at most one asterix character. The asterix (if any) can be replaced with an arbitrary sequence (possibly empty) of lowercase letters. No other character of string a can be replaced. If it is possible to replace the asterix in a to obtain string b, then string b matches the pattern."
For me ut is simple as that.
Can you give me any example when my sollution is wrong ?
Your solution isn't complete. For example, try adding this test case:
Test.assert_equals(solve("code*code","codewars"), False)
Your solution would return True, when it's clearly wrong.
Your solution is incorrect, the task isn't so simple. Read the description again, especially the first example. Also, add spoiler flag next time plz.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
got the same problem
How would you get rid of that?