but this will also consider digit, capital etc.
e.g. s1 = 'cedewaraaossoqqyt', s2 = 'codew4ars'
As per condition, answer should be "True" but above code will return "False"
Am i missing something?
Note that this solution has a complexity that is proportional to alphabet set size. If we're increasing possible character inputs this solution will timeout for sure ;-)
just try it and you'll realize that will awefully fail the performance tests.
This comment is hidden because it contains spoiler information about the solution
In Python explicit is better than implicithttps://www.python.org/dev/peps/pep-0020/
It is worth noting that using re.match instead of re.search provides, essentially, an implicit ^ to the regex argument. So, it could be left out in this instance.
I went through all my previous comments and marked them as spoiler as needed.
Thanks for letting me know. I assumed everything in the solutions section was hidden from anyone who hadn't completed the kata.
Please, do use the spoiler flag when you post comment (even here: comments about solutions are visible in the dashboard by anyone) with indications about the solution. I did flag your message.
Right... Good call. In that case, the sales table should have a default for the department id field set to 0, and then the unknown row would have an ID of 0
Because id cannot be null in table departments (cause PK), then no values will be provided for result.
If the db is built properly, the departments table would have a null row that would have the name "Unknown"
And what happens if the department_id field of the sales table is null your solution falls.
eval() is now disabled