Problem Solving In Data Structures & Algorithms... May 2026
Get it working first, then make it fast, then make it clean.
— Donald Knuth
Finding subarrays or substrings (e.g., "Longest substring without repeating characters"). Problem Solving in Data Structures & Algorithms...
A solution is only as good as its handling of the "weird stuff." Always test for: (null, empty strings, 0). Single elements (an array of size 1). Large inputs (integer overflows). Duplicates (especially in sorting or searching). The Golden Rule Get it working first, then make it fast, then make it clean
Before writing a single line, clarify the input size. Is 10610 to the sixth power ? This tells you if an solution is acceptable or if you must aim for Get it working first
Don't jump straight into your IDE. Professional problem solving follows a structured sequence: