02. Last K Numbers Sequence
Здравейте,
Само аз ли имам проблем със следната задача:
https://judge.softuni.bg/Contests/Practice/Index/2752#1
решението ми е:
https://pastebin.com/Va1HaBPQ
което си работи локално, но джъдж дава следната еднотипна грешка:
C:\Windows\TEMP\ExecutionStrategies\uysva3uc.54v\tmp88B5.tmp:99 let adapterFunction = ([n, k], code) => code(Number(n), Number(k)).join('\n') ^ TypeError: code(...).join is not a function at adapterFunction (C:\Windows\TEMP\ExecutionStrategies\uysva3uc.54v\tmp88B5.tmp:99:68) at Socket.<anonymous> (C:\Windows\TEMP\ExecutionStrategies\uysva3uc.54v\tmp88B5.tmp:105:18) at Socket.emit (events.js:214:15) at endReadableNT (_stream_readable.js:1178:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)
*когато подам като вход console.log пак е същото:
C:\Windows\TEMP\ExecutionStrategies\b2jv5not.qtr\tmpAEF1.tmp:81 let adapterFunction = ([n, k], code) => code(Number(n), Number(k)).join('\n') ^ TypeError: Cannot read property 'join' of undefined at adapterFunction (C:\Windows\TEMP\ExecutionStrategies\b2jv5not.qtr\tmpAEF1.tmp:81:67) at Socket.<anonymous> (C:\Windows\TEMP\ExecutionStrategies\b2jv5not.qtr\tmpAEF1.tmp:87:18) at Socket.emit (events.js:214:15) at endReadableNT (_stream_readable.js:1178:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)
може би аз нещо бъркам?
П.С. В допълнение -- 06. Bigger Half
*когато подам като вход console.log пак е същото:
(като я реша локално ще кача и решението си) -- ето и решение ---
function biggerHalf(input) {
input.sort((a, b) => a - b);
let secondHalf = Math.ceil((input.length - 1) / 2);
let result = input.slice(secondHalf);
return `[${result.join(", ")}]`;
}
C:\Windows\TEMP\ExecutionStrategies\e5srndrm.x0x\tmp5A55.tmp:81 let adapterFunction = (i, c) => c(i.map(Number)).join('\n') ^ TypeError: Cannot read property 'join' of undefined at adapterFunction (C:\Windows\TEMP\ExecutionStrategies\e5srndrm.x0x\tmp5A55.tmp:81:49) at Socket.<anonymous> (C:\Windows\TEMP\ExecutionStrategies\e5srndrm.x0x\tmp5A55.tmp:87:18) at Socket.emit (events.js:214:15) at endReadableNT (_stream_readable.js:1178:12) at processTicksAndRejections (internal/process/task_queues.js:80:21)