Longest Common Subsequence

Longest Common Subsequence

You are given two sequences. Write a program to determine the longest common subsequence between the two strings (each string can have a maximum length of 50 characters). NOTE: This subsequence need not be contiguous. The input file may contain empty lines, these need to be ignored.

Example 1:


input data:
XMJYAUZ;MZJAWXU
output:
MJAU

Example 2:


input data:
GJhbxu;Jyu7bia
output:
Ju

This is a CodeEval challenge. Test your answer on CodeEval.

Seda
Seda Kunda is a web designer and developer with a degree in Computer Science and a great passion for code. Besides code, she enjoys pepperoni pizza, watching the bachelor and sleeping in on Saturdays.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn