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
ugh I wasn't sure you could use modulo in bash
This comment is hidden because it contains spoiler information about the solution
surprised i had to scroll so far down to find a solution using filter, which was my first instinct until I couldn't remember the syntax so I just went for comprehensions instead.
i love it! this is poetry
just another "god damnit why couldn't I think of that" moment on codewars
i agree I think this is the most elegant solution.
eval does feel kind of cheap. I had the opposite experience sort of. I just retraine on this kata and I used eval() and when I went and looked at my first solution I was like, "Holy shit, did I really write this?!" I think i did since it didn't get any variations. Plus eval is almost never a good idea for security reasons.
the result will only be zero if the number is an integer. That is what makes this solution so clever, if the square root is not an integer, then the number is not square.
ahhh this seems so obvious in retrospect i love to hate it!!
damn this is one of the best solutions of all time
this is a thing of beauty
the kata needs clarification but I think if it meant to return "bye" and not "e" then it should also return "hi" if "hi" is the only argument. otherwise it's inconsistent. what if the arguments were
("hello", [1, "world", [2, 3]])
? Should it return[1, "world", [2, 3]]
,[2, 3]
, or3
?It's ambiguous. IMO, it should return ["123"]. It says to return the last element, not the last element of the last element.
Kata needs clarification IMO.
ah, this is what I was trying to do.
Loading more items...