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
no, their tests are not working, could you please solve this problem
Ohh woww cool solution ^^^
Ohh woww cool solution ^^^
Ohh woww cool man ^^^
Ohh woww cool man ^^^
My good solution :S
my good solution
Thx.
i
should equal1
, there is no reason to comparearr[0]
to itself.O(nlogn)
Just wanted to fix the tests and try this kumite thing oout ;)
what is this ?? I've never looked at it this way.
function duplicateEncode(word) {
var letterCount = [];
var letters = word.toLowerCase().split('');
console.log(letters);
letters.forEach(function (letter) {
letterCount[letter] = (letterCount[letter] || 0) + 1;
});
console.log(letterCount);
return letters.map(function (letter) {
return letterCount[letter] === 1 ? '(' : ')';
}).join('');
}
oh very good solution, I like it .
Loading more items...