dynamic_programming.longest_palindromic_subsequence

author: Sanket Kittad Given a string s, find the longest palindromic subsequence’s length in s. Input: s = “bbbab” Output: 4 Explanation: One possible longest palindromic subsequence is “bbbb”. Leetcode link: https://leetcode.com/problems/longest-palindromic-subsequence/description/

Functions

longest_palindromic_subsequence(→ int)

This function returns the longest palindromic subsequence in a string

Module Contents

dynamic_programming.longest_palindromic_subsequence.longest_palindromic_subsequence(input_string: str) int

This function returns the longest palindromic subsequence in a string >>> longest_palindromic_subsequence(“bbbab”) 4 >>> longest_palindromic_subsequence(“bbabcbcab”) 7