Skip to content

Commit 67843a6

Browse files
committedOct 19, 2024
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent fb520a3 commit 67843a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎strings/check_anagram.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
str2 = str2.lower()
77

88
# check if length is same
9-
if(len(str1) == len(str2)):
10-
9+
if len(str1) == len(str2):
1110
# sort the strings
1211
sorted_str1 = sorted(str1)
1312
sorted_str2 = sorted(str2)
1413

1514
# if sorted char arrays are same
16-
if(sorted_str1 == sorted_str2):
15+
if sorted_str1 == sorted_str2:
1716
print(str1 + " and " + str2 + " are anagram.")
1817
else:
1918
print(str1 + " and " + str2 + " are not anagram.")

0 commit comments

Comments
 (0)