← Microsoft questions

Check anagrams with sorting

Filed under Microsoft

Given two strings s and t, write a function to determine if t is an anagram of s. Use the sorting approach where both strings are sorted and compared character by character.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.