- Notifications
You must be signed in to change notification settings - Fork2.4k
Closed
Description
Bug Report forhttps://neetcode.io/problems/is-anagram
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Not enough test cases for this question. The tests only check character membership, not counts.
The following code passes all NeetCode tests:
classSolution:defisAnagram(self,s:str,t:str)->bool:iflen(s)!=len(t):returnFalsesetS=set(s)forcharint:ifcharnotinsetS:returnFalsereturnTrue
But it's actually invalid, since this input would fail:
s="aabb"t="abbb"
Metadata
Metadata
Assignees
Labels
No labels