Decodestring Codefights: Program Doesn't Pass All Tests."30/31 Output Limit Exceeded On Test -31". Kindly Support
function decodeString(s) { let arr = []; let digitSum = ''; let digitSumArr = []; // for numbers before '[' let i; //iterating string for (i = 0; i < s
Solution 1:
The problem is that the failed test has an input of sufficient complexity to require more time to solve than the allotted limit, given your solution. So, you need to find a more efficient solution.
I ran a performance benchmark on your solution and on another solution which used recursive procedure calls, and yours was 33% slower. I suggest you refactor your solution to call your parsing procedure recursively when you encounter nested iterations.
Post a Comment for "Decodestring Codefights: Program Doesn't Pass All Tests."30/31 Output Limit Exceeded On Test -31". Kindly Support"