**Problem:** Given two sequences X =
and
Y =
, find the longest subsequence
Z =
that is common to x and y.

A subsequence is a subset of elements from the sequence with strictly increasing
order (not necessarily contiguous).

For example, if X = A,B,C,B,D,A,B and Y =
B,D,C,A,B,A, then some common subsequences are:

- A
- B
- C
- D
- A,A
- B,B
- B,C,A
- B,C,B,A This is one of the longest common subsequences.
- B,D,A,B This is one of the longest common subsequences.

Brute Force: Check all 2^{m} subsequences of X for an occurrence in Y.