Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions strings/check_anagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@

def check_anagrams(first_str: str, second_str: str) -> bool:
"""
Two strings are anagrams if they are made up of the same letters but are
arranged differently (ignoring the case).
Check whether two strings are anagrams of each other.
Two strings are anagrams if they contain the same characters
with the same frequency, ignoring case and whitespace.
:param first_str: first input string
:param second_str: second input string
:return: True if strings are anagrams, False otherwise
>>> check_anagrams('Silent', 'Listen')
True
>>> check_anagrams('This is a string', 'Is this a string')
Expand Down