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.
Does not work properly when a negative number is given
Wow, & is a good use
Rejected due to
No sample tests
No random tests
Description merge conflict
Author long gone
You could also do (0...number) instead of (1...number)
Interesting! I was not aware of the range syntax with 3 dots, where 1...n exludes the end of the range.
This comment is hidden because it contains spoiler information about the solution
The
crypt_password!
method manipulatesgiven.password
, replacing its content with the return value ofString#crypt
.So by the time the comparison happens,
given.password
will already contain the cryptographic hash.O my love. So beautiful
short and pithy,easy to read
Solved.
I can remove them, but I would label that as a suggestion, more than as an issue...
Why the test don't pass even though I provide username, password
from the SecureLogin::ADMIN in Frontend#given_credentials?
https://www.evernote.com/l/AYOBsQGpQexNub3hg406G6kKJBP9exJLUNQ
@user = user if (user.password == given.password)
Why plain user.password is tested for equality against crypted given.password?You don't need to get min and max of them. If you are summing over whole array, it doesn't matter which if you reduce or reduceRight.
sum of [-2, -1, 0, 1, 2] is the same as sum of [2, 1, 0, -1, -2]
And you don't need fat arraow :)
Happy coding!
.
If you are no longer facing any trouble, you should mark this issue as resolved.
You can do that by replying to it and clicking on the appropriate box below the comment area.
Loading more items...