Prime Anagrams

Can Someone help me to solve this problem
Here is the link https://community.topcoder.com/stat?c=problem_statement&pm=3458&rd=5869