Capital One Interview Question

Technical Interview: How to separate a string of anagrams.