Given a string s consisting of lowercase English letters, compute how many distinct palindromic subsequence strings of lengths 2, 3, and 4 can be formed from s.
A subsequence is formed by deleting zero or more characters without changing the relative order of the remaining characters.
Count palindromes by their resulting string value, not by the number of index combinations. For example, if the same palindrome can be formed in multiple ways, it should be counted only once.
Return three values:
-
the number of distinct palindromic subsequences of length 2,
-
the number of distinct palindromic subsequences of length 3,
-
the number of distinct palindromic subsequences of length 4.
Examples of valid palindromes include aa for length 2, aba for length 3, and abba or aaaa for length 4.