diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2023-02-14 16:41:24 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2023-02-14 16:41:24 +0100 |
| commit | eb4bc75111da45a17604fdff2f9eed0977f93dff (patch) | |
| tree | ffd990c0cc12a73c897a6e5c0d8216ce178a78c5 /string/longestCommonSubsequence.cpp | |
| parent | f07738a30c46f0a277af5609a3b4c4b01674ad84 (diff) | |
moved more stuff
Diffstat (limited to 'string/longestCommonSubsequence.cpp')
| -rw-r--r-- | string/longestCommonSubsequence.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/string/longestCommonSubsequence.cpp b/string/longestCommonSubsequence.cpp index fa1adb6..2a0b74c 100644 --- a/string/longestCommonSubsequence.cpp +++ b/string/longestCommonSubsequence.cpp @@ -5,7 +5,7 @@ string lcss(string& a, string& b) { if(a[y] == b[x]) m[y][x] = 1 + m[y+1][x+1]; else m[y][x] = max(m[y+1][x], m[y][x+1]); }} // Für die Länge: return m[0][0]; - string res; int x=0; int y=0; + string res; int x = 0, y = 0; while(x < sz(b) && y < sz(a)) { if(a[y] == b[x]) res += a[y++], x++; else if(m[y][x+1] > m[y+1][x+1]) x++; |
