4 ms·
> but equally why not just precompute the whole range and do a binary search? what do you mean?
by shoo 9y ago
> but equally why not just precompute the whole range and do a binary search?
what do you mean?
- Veedrac 9y agoThe code finds the longest Collatz sequence below N, where N is a 32-bit integer. There are only ~1k longest sequences possible, so just list them all. Given N, search for the largest N below that and return its corresponding iteration count.