Pergunta de entrevista da empresa Sabre

Write a function to count the distinct groups of palindromes in a string.