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.
in the following test cases:
scramble_words('-dcba') == '-dbca'
as first char is "-" and last "a", shouldn't return value be "-bcda"?
scramble_words('dcba.') == 'dbca.'
as first char is "d" and last ".", shouldn't the return value be "dabc."?
Since the first and last characters remain in original place for each word. Thanks for any clarifiaction.
It doesn't say what to return if the array input is empty. I guess you return a []
This comment is hidden because it contains spoiler information about the solution
Your problem is in line 3 of your code:
But you're generating an empty array.
And then there is another problem:
Your code returns the first value, not the largest one.
This comment is hidden because it contains spoiler information about the solution
cool. I'll have alook
The problem is when you populate
clean_str
This comment is hidden because it contains spoiler information about the solution
I've renamed the function, there was a typo in its name, change it to
pangram
and click reset.It has both
T
andt
, your code is still not case insensitive.This comment is hidden because it contains spoiler information about the solution
Changed the error messages, but your code is wrong, it's not case insensitive.
This comment is hidden because it contains spoiler information about the solution
Thanks for clearing this up. Strings' lengths aren't necessarily the same.
That needs Ruby >= 2.7
What's wrong with array.tally?