Zepruv › Coding problems

Valid Anagram

Easy · Hash Table, String, Sorting

Given two strings s and t, return true if t is an anagram of s, and false otherwise.

Example 1

Input: s = "anagram", t = "nagaram"
Output: true

Example 2

Input: s = "rat", t = "car"
Output: false

Constraints

Starter code (python)

class Solution(object):
    def isAnagram(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        

Related problems

Previous: Different Ways to Add Parentheses · Next: Binary Tree Paths · All problems

Zepruv is a technical interview practice platform. Read any problem for free; sign in to run your code, submit and keep your progress.