Sale
Summer Offer: $190/yr $99/yr
00 : 00 : 00 : 00
Get this deal
Backend Engineer Senior programming

Write a function to determine if two strings are anagrams of each other. An Anagram is a word or phrase that is formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.


Constraints:


  • 1 <= s.length, t.length <= 5 * 10^4

  • s and t consist of lowercase English letters.


Examples:


1. Input: s = "anagram", t = "nagaram"
Output: true
2. Input: s = "rat", t = "car"
Output: false
Suggested Answer

Trusted by 100+ professionals preparing for interviews

Trusted by 100+ professionals 50+ Company Question Banks 5+ Supported Languages

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

Get Started Free
Link copied to clipboard