Valid Anagram Problem

Valid Anagram Problem — ExecCode Easy DSA Practice

Solve the Valid Anagram problem on ExecCode. Free online easy DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

Examples

Input s = "anagram", t = "nagaram"; Output true. Input s = "rat", t = "car"; Output false. Input s = "a", t = "ab"; Output false

Constraints

1 ≤ s.length, t.length ≤ 5 × 10⁴ s and t consist of lowercase English letters

Practice Valid Anagram free on ExecCode. Browse DSA problems, topic map, and placement guides.