Skip to content

Commit

Permalink
Merge pull request kodecocodes#686 from chrisco314/master
Browse files Browse the repository at this point in the history
Fix typo: bottom-left -> bottom-right
  • Loading branch information
kelvinlauKL authored Mar 12, 2018
2 parents feeabb9 + 5ff5830 commit eb95619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Longest Common Subsequence/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ And so on... this is how `lcsLength(_:)` fills in the entire matrix.

## Backtracking to find the actual subsequence

So far we've calculated the length of every possible subsequence. The length of the longest subsequence is found in the bottom-left corner of matrix, at `matrix[n+1][m+1]`. In the above example it is 4, so the LCS consists of 4 characters.
So far we've calculated the length of every possible subsequence. The length of the longest subsequence is found in the bottom-right corner of matrix, at `matrix[n+1][m+1]`. In the above example it is 4, so the LCS consists of 4 characters.

Having the length of every combination of substrings makes it possible to determine *which* characters are part of the LCS itself by using a backtracking strategy.

Expand Down

0 comments on commit eb95619

Please sign in to comment.