We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
sequence is t = 3 + 3 * 2 + 3 * 2^2 + ... 3 * 2^n + remainder
r = remainder
t = 3 * (2^(n + 1) - 1) + r
t >= 3 * (2^(n + 1) - 1)
n <= log2(t/3 + 1) - 1
that's how u estimated max n full cycles
Cookie support is required to access HackerRank
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 →
sequence is t = 3 + 3 * 2 + 3 * 2^2 + ... 3 * 2^n + remainder r = remainder t = 3 * (2^(n + 1) - 1) + r t >= 3 * (2^(n + 1) - 1) n <= log2(t/3 + 1) - 1 that's how u estimated max n full cycles