write spec and solve anagram for two types of inputs