PythiloLesson 29 of 32 · progress kept in this browser

Compare two strings with a 2D table

A subsequence keeps characters in order but may skip some. The longest common subsequence of two texts measures how similar they are, and diff tools build on the same table.

a, b = "abcde", "ace"
# common subsequence: "ace", length 3
Your task

Write lcs_length(a, b) returning the length of the longest common subsequence of two strings.