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.
Nice solution.
A good optimization, should be to
return false
as soon as a letter ofname
is not found,instead of waiting to check the whole word.
It makes the execution faster in case
name
is a very very long string.This is my solution https://www.codewars.com/kata/reviews/59daf6b49d7fbd38ed000ec7/groups/686e2938d2116ba693ff964f
if you want to check.
This comment is hidden because it contains spoiler information about the solution
nice
sry I mean snake case not camel case (got the other way round)
You've done snake case, not camel case.
yeaa because this is ruby which uses camel casing not JS
Is
double_every_other
preferred overdoubleEveryOther
in Ruby?Thanks! That makes it clear now
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Please consider this is used in a real codebase:
The above outputs
[]
instead of[2,3,5]
, because the arrayfoo
was modified from inside thedistributionOf
function. Functions shouldn't mutate their parameters.hi there!
I am new coding, I solve this kata, but I really want to understand how you do it.
Could you please explain a lil bit for me.
Thank you, nice work!
Wow, multiline passwords? Give me two! :D
Nice, perfect solution. I had to check if you were the author, haha.
The table is a mapping between the number of the bowling pin and the index of that pin in the output string: 'I I I I\n I I I \n I I \n I '
For example, pin #7 is the first character in the string, index 0. Pin #8 is at index 2.
For each pin to be removed, I replace that index in the output string with a space.
This version might be a little clearer:
Loading more items...