Sabre Interview Question

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