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.
A line break or a tab or any other whitespace character (which trims to zero-length) will break this program; the word splitting is just bare enough to pass the tests.
That's probably more future-proof way for real production code, except I'd use ES6 spread for
Math.min
.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
While not very efficient for exactly this task; this algorithm does have the future! Image your Product Manager comes in and asks to tweak the function, to count per-language. You'd pass not only a string, but locale as well. In this case, you'd have to check the Unix index numbers of each character, because let's say Urdu could have some English characters sprinkled inside and thus void the unique character count.
redundant
i
regex flagthe "case insensitive" regex flag
i
is redundantThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
only until you try to put that in TypeScript — https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABACxgc2QQTAEwDJwDuAFGCALYBGApgE4DOAXIvVLTGGgJQDeAUIkQAbalEQBDWrUQBeRGSp16AOnoAHITCjEA5Ih1dEAeiPLy4tcQByFGrS4BuQQMS1RIWkgCy4qMjPiAB7EyqGS9ogA1Pox0T5+ZhwhYVKOfAC+QA — if you want to find a job, very likely it will be of writing TS, not JS
This comment is hidden because it contains spoiler information about the solution
Loading more items...