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.
JavaScript tests work fine now.
Use
===
instead of==
.Your shorter solution doesn't work because it doesn't select the character following the dash or hyphen.
Agreed. My only issue readability. Even though it's easy for me to understand. I think it should be more readable for other coders who are fairly new. Helps them and the community grow much faster
This comment is hidden because it contains spoiler information about the solution
ahhhh, Makes sense. Thanks
The last test case has 10000000 elements. SIGKILL happens because you exhausted all program memory by making a string too big.
This comment is hidden because it contains spoiler information about the solution
Read carefully the Kata description again. 66 people have been able to solve it in Javascript so far.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
like you said, if two words have the same length.
reduce
will compare them by index. The first to appear will be called. In this casereason
Theres an error in your code test
Test.assertEquals(longestString('now for some reason my shoe smells funny'), "reason", "try again");
the string lenth of reason & smells equals the same
reason.length === smells.length
so reason can't be the longest word by it's lone some. You should create a test that responds to the case and have coders also check for the edge case. Happy Coding
Interesting I should have went this route. would have saved me one line. Love how clean it come out. Great job
Lol I came to the same conclusion
Loading more items...