Rakuten interview question

Codility test - anagram problem