Common Mistakes

Common errors to avoid

  • Sorting by wrong endpoint: Merge problems sort by start; scheduling problems often sort by end.

Know which applies.

  • Wrong overlap condition: Intervals [1,3] and [3,5] touching at point 33 may or may not overlap depending on problem definition.
  • Not handling empty input: Empty interval list should return empty result, not crash.
  • Modifying intervals while iterating: Build result in separate list rather than modifying input during processing.