Longest common subsequence · Compiler
Longest common subsequence
Find the greatest length of a sequence that can be obtained from both strings by deleting zero or more letters. Each retained letter keeps its original order and each position may be used once.
- Input
- Two lines, one string per line. Each string has 0 to 100 uppercase English letters. A single dash (-) represents the empty string.
- Output
- Print the longest common subsequence length as an integer.
Compiler Explorer runs your code when you run or check it.
Loading your exercise draft…