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 problem with your code is not a kata issue, read this: https://docs.codewars.com/training/troubleshooting
This comment is hidden because it contains spoiler information about the solution
Actual output encoding and formatting should be specified.
This can be discerned from example tests, but solvers should not be forced to enter a trainer for that.
i rewrote the reference solution (in both tests suite and solution panel); it should be fixed
Didn't even know this was a thing. Here I am doing while loops like some kind of pleb haha
Wondering how exactly this is Object Oriented?
I'm looking for some pointers on making this more efficient. It's failing due to it taking too long to execute the 5500+ tests that this Kata runs.
function transposeTwoStrings(arr) {
var twoStrings = '';
var string1 = arr[0];
var string2 = arr[1];
var longestString = arr.sort(function(a, b) {
return b.length - a.length;
})[0].length;
for (i = 0; i < longestString; i++) {
twoStrings += (string1[i] || ' ') + ' ' + (string2[i] || ' ') + '\n';
}
return twoStrings.slice(0, -1);
}
This comment is hidden because it contains spoiler information about the solution
In any case, this isn't the kata's problem so it's not an issue.
Internal solution for the random test cases is flawed: it throws
Cannot read property 'length' of undefined
if both arguments are empty strings (which happens about once in 625 times).This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
My solution passed in 325 ms. I think you concatenate string inefficiently.
Can we please look at reducing the amount of test cases for the final? I can't pass the test because it's taking too long to complete.
I've got over 3000 random strings generated for the final tests. It goes beyond the 12000ms allowed by Kata and it's failing.
Loading more items...