From eb4bc75111da45a17604fdff2f9eed0977f93dff Mon Sep 17 00:00:00 2001 From: MZuenni Date: Tue, 14 Feb 2023 16:41:24 +0100 Subject: moved more stuff --- string/longestCommonSubsequence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string/longestCommonSubsequence.cpp') 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++; -- cgit v1.2.3