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 man ^^^
My good solution :S
my good solution
Thx.
i should equal 1, there is no reason to compare arr[0] to itself.
i
1
arr[0]
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 collection data...
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...