Solution Walkthrough

By looking at the given string, the problem seems very simple. But programming a computer to solve it requires some thought. The first approach that may come to your mind is to directly check for palindromic subsequences and find the one with the longest length. Let's see how this would work.