Question
Given two strings
s
andt
, returntrue
ift
is an anagram ofs
, andfalse
otherwise.
This is anarrays question.
Idea
Use “Counter()” to create a hashmap of the letters of the two words and compare the hashmaps together.
Search
Question
Given two strings
s
andt
, returntrue
ift
is an anagram ofs
, andfalse
otherwise.
This is anarrays question.
Idea
Use “Counter()” to create a hashmap of the letters of the two words and compare the hashmaps together.