Thomson Reuters interview question

An anagram coding problem.