UVa 10405

From Algorithmist
Jump to navigation Jump to search

10405 - Longest Common Subsequence[edit]

Summary[edit]

Given two strings, find the Longest Common Subsequence.

Explanation[edit]

Textbook Dynamic Programming problem. No tricks to it.

Gotchas[edit]

  • The input includes some blank lines.

Implementations[edit]

Input[edit]

a1b2c3d4e
zz1yy2xx3ww4vv
abcdgh
aedfhr
abcdefghijklmnopqrstuvwxyz
a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0
abcdefghijklmnzyxwvutsrqpo
opqrstuvwxyzabcdefghijklmn
aaaaab
aab

Output[edit]

4
3
26
14
3