Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
kalathilhemanth
Is this a valid solution?

kalathilhemanth

May 4, 2025

class Solution:   def isAnagram(self, s, t):       char_t = list(t)     char_s = list(s)     for x in s:       try:         char_t.remove(x)         char_s.remove(x)       except:         return False         if len(char_s) == 0 and len(char_t) == 0:       return True           return False

0

0

Comments
Comments