Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Valid Anagram String Check
00:00
5 left

Valid Anagram String Check

EasyPython

Problem

Given two strings s and t, return true if t is an anagram of s, and false otherwise. Two strings are anagrams if they contain exactly the same characters with the same frequencies, possibly in a different order.

Constraints

  • 1 <= len(s), len(t) <= 5 * 10^4
  • s and t consist of lowercase English letters
  • Repeated characters must be matched by frequency

Function Signature

def is_anagram(s, t):
Interviewer

Your question is Valid Anagram String Check. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.