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.
This comment is hidden because it contains spoiler information about the solution
the 'g' flag means global
'g' flag -> apply to all chars in the input string until reaching the end || [regexp definition] do not return after the first match
so without the 'g' flag it will stop at the first set of matches of a single char
with the 'g' flag it will continue past the first set and apply the rule to remaining sets giving the correct count
You can print the input and try to count the duplicate by hand to see for yourself ;-)
Passed all suites except last one. Are you sure expected value should be 2 not 1? (It concerns attempt cases not sample test)