Strings can be segregated into both their letter and digit components.
To illustrate:
"cab97ac79"
# double-palindrome: "cabac" and "9779" are both palindromes.
"1abc4de1"
# single-palindrome: "141" is a palindrome.
Write a function that maps double palindromes to the number 2, single palindromes to the number 1, and everything else to the number 0.
palindrome_set(["cb77c", "ccc888", "ccc789", "abc89"]) ➞ [2, 2, 1, 0]
palindrome_set(["789", "555", "ccc", "abba"]) ➞ [0, 1, 1, 1]
palindrome_set(["7a", "5f", "6c"]) ➞ [2, 2, 2]