You are viewing a single comment's thread. Return to all comments →
Solution in Typescript
function strangeCounter(t: number): number { let i = 0; let value = 0; while (!value) { let endOfRange = 3*((2 * i) + 1); if (t <= endOfRange) { value = 1 + (endOfRange - t); break; } i = 2 * i + 1 } return value; }
Seems like cookies are disabled on this browser, please enable them to open this website
Strange Counter
You are viewing a single comment's thread. Return to all comments →
Solution in Typescript