then we can move to the larger of , - and - , we continue this process until reaching some , (for exampleif or is as boundary casea python implementation of this strategy is given in code fragment this function constructs longest common subsequence in ( madditional timesince each pass of the while loop decrements either or (or bothan illustration of the algorithm for computing the longest common subsequence is given in figure def lcs solution(xyl) """return the longest common substring of and ygiven lcs table "" solution , len( )len( while [ ][ common characters remain if [ - = [ - ] solution append( [ - ] - - elif [ - ][ > [ ][ - ] -= else - return left-to-right version return join(reversed(solution)code fragment reconstructing the longest common subsequence =gttcctaata ycgat aat gaga figure illustration of the algorithm for constructing longest common subsequence from the array diagonal step on the highlighted path represents the use of common character (with that character' respective indices in the sequences highlighted in the margins