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.
Great solution. Easy to understand.
This comment is hidden because it contains spoiler information about the solution
/\d\d\d|\d\d|\d/g
can be replaced with/\d{1,3}/g
Yet another comedy.
When did Codewars become a comedy show?
You can use ESLint or Prettier to achieve this format.
This comment is hidden because it contains spoiler information about the solution
Haha. What a joke!
Thumb down 👎
In my understanding, this kata doesn't put any restriction on the input strings. So, 'abc' and 'c' are both valid strings. And what I want to comment is the RegEx solution can't cover special cases.
Edit: Oh, now I understand that this RegEx solution is for the old version of this kata, and it was correct. Now the kata has changed, and it's no longer accurate. Anyway, I think we can update the test cases, but the kata's original description should not be changed. Otherwise, the solutions won't be consistent.
This solution is not correct for special cases such as:
solution('ab(c)', '(c)');
solution('abc\', 'c\');
solution('abc+', 'c+');