Upwind interview question

the known Anagram Leetcode question