Find the bug
Code that looks right and is not. Run it, find the bug, fix it with the smallest change.
- Fix the Binary Search A binary search that misses some targets: find the off-by-one and fix it.
- Fix the Two Sum Hash Map A one-pass Two Sum that sometimes pairs a number with itself.
- Fix the Longest Substring Without Repeats A sliding window whose left edge sometimes moves backwards.
- Fix Merge Intervals An interval merge that shrinks intervals when one contains another.
- Fix the Mutable Default Argument A Python helper whose results leak from one call into the next.
- Fix the Substring Check A contains-check that says no when the match is at the very start of the string.
- Fix the Median (JavaScript Sort) A median function that is right for single digits and wrong for 10.
- Fix the Number Parser (map + parseInt) A one-line parser that turns most of its input into NaN.
- Fix the Async Total (forEach) An async loop that returns before any of its work has finished.
- Fix the Bill Splitter Splitting money with rounding loses or invents cents.
- Fix the Pagination Helper Page 1 shows the second page of results.
- Fix the TTL Cache Expiry A TTL cache that serves entries one tick after they expired.
- Fix Removing Items While Iterating Deleting from a list inside the loop that walks it skips elements (or throws, in Java).
- Fix the Word Counter A word counter that counts the spaces between words, and counts one word in an empty string.
- Fix the Bracket Validator A bracket validator that accepts brackets that were opened and never closed.