4 ms·
Nice 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.
by igoros 14y ago
Nice 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.