**Problem Statement:**
Given the required input arguments, write an efficient algorithm to solve the **Longest Palindromic Subsequence** problem. Implement the required logic as specified by standard definitions for this classic algorithmic challenge.
**Hint / Expected Approach:**
2D DP or reverse + LCS
**Edge Cases to Consider:**
- (1) All same characters
- (2) Single character
- (3) No repeated chars
Examples
Example 1
Input:"bbbab"
Output:4
Explanation: "bbbb" (delete a) wait: "bbab" → "bbb" not possible. "bbbb"? Only 3 b's. "bbab"→ LPS is "bbb"? No: positions 0,1,3 are "bbb" length 3, or 0,1,2,4 = "bbbb"? char at 4 is 'b'. Yes: "bbbb" length 4