Remove Palindromic Subsequences

Problem Id: 1332 Difficulty: Easy Tag: String


Intuition

Solution


class Solution:
    def removePalindromeSub(self, s: str) -> int:
        if not s:
            return 0
        if s == s[::-1]:
            return 1
        return 2