One solution is to check for A.length on the loop conditions section. function solution(A, K) { for (i = 0; i < K && A.length; ...
確定! 回上一頁