4 ms·
Yup. I updated my comment with working code. Just figure out the small case, and extrapolate once you find a match.
by harpastum 14y ago
Yup. I updated my comment with working code. Just figure out the small case, and extrapolate once you find a match.
- igoros 14y agoNice approach! It's O(1) to find a candidate solution, but of course it will still be O(N) to verify that the solution really works.