A different approach to this problem


#1

Think about mapping the characters to prime numbers.