You are viewing a single comment's thread. Return to all comments →
I am getting request timeout for test case 8... anyone with same problem?? or anyone knows the solution??
The test case is a large array with a large amount of shits. If your algorithim is not effecient than it will time out.
Array size: 73642
Left shifts: 60581
I agree that it timesout if the algorithm is not efficient enough. Instead of relying on rudimental loops, try using a linked list which simplifies its complexity significantly to O(dn).
var b = a.splice(0, d);
a = a.concat(b);