Easy64.7% acceptance

Valid Anagram

Determine whether two strings contain the same characters with the same frequencies.

Topics

HashingStrings

Examples

Input: s = "anagram", t = "nagaram"
Output: true
Input: s = "rat", t = "car"
Output: false

Expected Complexity

O(n) time and O(1) auxiliary space for lowercase English letters.

What happens after Submit?

ERROR DNA analyzes your submission and identifies recurring patterns in your mistakes.

solution.cppC++17
Loading...
C++17