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.
@pescadomuerto: when it comes to time complexities, most of the time comparing the number of passes is meaningless. You're currently sort of saying that
3*n != n*3
. That's why the asymptotic behavior is ignoring the constant factors.This comment is hidden because it contains spoiler information about the solution
Your solution goes over the set for each iteration of the for loop - this means in the worst case scenario it is O(n^2).
i got that.
thanks for the tips :D
Many people have suggested this, but it doesn't really do anything. It's just re-labeling and re-leveling the playing field. Newbies and people with bad taste will still do their thing, and they'll utilize the downvote button too so it's not like giving everyone more power will make wiser people more influencial.
I would like to see a "downvote" option. Perhaps moderated to avoid abuse, and requiring a justification for the downvote. I see bad solutions upvoted as best practices, and that's not healthy for a learning tool.
I note that most answers in languages that allow null values for the pin parameter do not correctly handle the null case. And while I would not use a Regex to solve this problem in real life, the title of the kata indicates that this regex are to be used -- TryParse or its ilk are not valid answers.
This is a mostly correct solution. If pin is null, then this implementation will throw ArgumentNullException, which violates the specification that the function return false for any input other that 4 or 6 digits.
This comment is hidden because it contains spoiler information about the solution