Join Nostr
2026-10-14 06:38:00 UTC

codementor on Nostr: Learn: Brute force first, then improve If you don't see the best solution right away, ...

Learn: Brute force first, then improve

If you don't see the best solution right away, say the simple one first, with its Big-O. For example: "Check every pair: O(n²)."

Then ask yourself what work is repeated. A HashSet, sorting, or two pointers often removes it. A working slow answer beats an unfinished fast one.

#tip · TIP-003