Skip to content

Conversation

@kq58
Copy link
Contributor

@kq58 kq58 commented Aug 10, 2021

this could be an implementation of lps. it can return the logestSubStr as well.you can remove the '#' in the last line to do it.

L[i][j] = max(L[i][j-1], L[i + 1][j]);

return L[0][n-1]
def longest_palindromic_subsequence(s):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a multiline comment with the algorithm descriptions, please?

@kq58
Copy link
Contributor Author

kq58 commented Aug 10, 2021

i'm new to git, is this right?

@ericklarac
Copy link
Collaborator

@kq58 yeah it looks good, just added a small comment, to add a brief description of your algorithm.

@ericklarac ericklarac merged commit d54f4a5 into keon:master Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants