You are viewing a single comment's thread. Return to all comments →
Nice one!
js version:
function viralAdvertising(n) { let t = 2, c = t while(--n) // c += t = (t * 3 / 2)|0 // <--- alternative floor method c += t += t >> 1 // <--- faster floor method return c }
Seems like cookies are disabled on this browser, please enable them to open this website
Viral Advertising
You are viewing a single comment's thread. Return to all comments →
Nice one!
js version: