Thomson Reuters Interview Question

An anagram coding problem.