Skip to content

Commit 6cf5e1d

Browse files
committed
correct method using LCS to find LRS
1 parent 58bb43b commit 6cf5e1d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Dynamic Programming/LongestRepeatingSubsequence.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include<iostream>
22
#include<string>
3+
#include<algorithm>
34

45
using namespace std;
56

@@ -48,6 +49,7 @@ string LRS(string a,int m)
4849
j--;
4950
}
5051

52+
reverse(lrs.begin(),lrs.end());
5153
return lrs;
5254
}
5355

0 commit comments

Comments
 (0)