Back to articles
Valid Anagram
News

Valid Anagram

via Dev.to BeginnersSaranya R

Approach Explanation /(^ω^)/ I counted how many times each letter appears in both strings using len function. If the counts match exactly, the strings are anagrams. Otherwise, return False. Method Used: (〜 ̄▽ ̄)〜 Length check Character frequency counting Comparison of counts Efficient solution

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
6 views

Related Articles