You are right that arguments are strings, but the way how you use downcase is not fully correct. How will your solution work for string "aA"? What will word.count(l) return for each character?
The Issue tag is meant to be used when you find a bug or some other problem in a kata, and something needs to be fixed. In this case, your problems are caused by a bug in your solution. There is nothing to fix in the kata.
Your code has some problems, not a kata issue. map doesn't mutate the array in place and there is also another problem with the code you posted that I'll let you figure out. Use Question label next time.
i added better assertion messages to Ruby. your code is wrong, downcase is not a mutating method, so think about how it affects the logic of your code. please do not raise issues so lightly in the future, ask a question instead to ask for help
That's because that syntax requires at least MRI 2.6. I've updated it to MRI 3.0.0 and it works now.
Your current code works, so I can't tell you what was wrong with another version.
You are right that arguments are strings, but the way how you use
downcase
is not fully correct. How will your solution work for string"aA"
? What willword.count(l)
return for each character?The
Issue
tag is meant to be used when you find a bug or some other problem in a kata, and something needs to be fixed. In this case, your problems are caused by a bug in your solution. There is nothing to fix in the kata.Your code has some problems, not a kata issue.
map
doesn't mutate the array in place and there is also another problem with the code you posted that I'll let you figure out. UseQuestion
label next time.i added better assertion messages to Ruby. your code is wrong,
downcase
is not a mutating method, so think about how it affects the logic of your code. please do not raise issues so lightly in the future, ask a question instead to ask for help