Skip to main content
LeetCode 712, Medium. Topics: String, Dynamic Programming, Longest Common Subsequence. View on LeetCode. Generate this problem as a practice environment: tested reference solution, 20 parametrized pytest cases, and a playground notebook:

Problem

Given two strings s1 and s2, return the lowest ASCII sum of deleted characters to make two strings equal.

Examples

Constraints

  • 1 <= s1.length, s2.length <= 1000
  • s1 and s2 consist of lowercase English letters.

Solution

Reference implementation from solution.py on GitHub, full suite in test_solution.py:

Complexity

Tags

Last modified on September 7, 2026