CHALLENGES

Back to home page
  • Longest Common Subsequence

    Challenge Description:

    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.

    Input sample:

    The first argument will be a path to a filename that contains two strings per line, semicolon delimited. You can assume that there is only one unique subsequence per test case. E.g.

    XMJYAUZ;MZJAWXU

    Output sample:

    The longest common subsequence. Ensure that there are no trailing empty spaces on each line you print. E.g.

    MJAU
Login to submit solution