MathWorks Interview Question

Problem involving counting anagrams efficiently