You are viewing a single comment's thread. Return to all comments →
Typescript:
let len = c.length; let pButton = 1 + k * 2; let adj = len - k - 1 + pButton; let result = Number.MAX_SAFE_INTEGER; for (let i = 0; i <= k; i++) { const rem = (adj - i) % pButton; if (rem && rem <= k) continue; let count = 0; for (let j = i; j < len && count < result; j += pButton) { count += c[j]; } result = Math.min(result, count); } return result;
Seems like cookies are disabled on this browser, please enable them to open this website
Turn Off the Lights
You are viewing a single comment's thread. Return to all comments →
Typescript: