From b65d2861a83bd114a7f93f9ce3672442830fb8f2 Mon Sep 17 00:00:00 2001 From: dhruvakidadumbe Date: Mon, 29 Dec 2025 23:00:14 +0530 Subject: [PATCH] Improve docstring clarity for anagram check function --- strings/check_anagrams.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/strings/check_anagrams.py b/strings/check_anagrams.py index d747368b2373..03e2c50c3304 100644 --- a/strings/check_anagrams.py +++ b/strings/check_anagrams.py @@ -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')