Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Check Anagrams Function

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Check Anagrams Function. Start with the requirements on the right.

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.

Problem

CoStar may compare normalized listing tokens during property data processing. Given two strings, determine whether they are anagrams of each other.

Two strings are anagrams when they contain exactly the same characters with the same frequencies, possibly in a different order. The comparison is case-sensitive, and each input contains only lowercase English letters.

Formal Specification

Implement functionSignature with two strings, s and t, as input. Return True if they are anagrams and False otherwise. The function must not modify either input string.

Constraints

  • 0 <= len(s), len(t) <= 5 * 10^4
  • Each character is a lowercase English letter
  • The inputs may be empty strings

Function Signature

def are_anagrams(s, t):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output