Conversation
juliagallucci
left a comment
There was a problem hiding this comment.
You're close! For part B, the logic is incorrect- the expression (is_case_sensitive == (sorted(word_a) == sorted(word_b))) only compares the sorted original words to the is_case_sensitive flag, which does not correctly enforce case-sensitive checks for all letters.
A better approach is to convert both words to lowercase only if is_case_sensitive is False, then simply compare sorted(word_a) and sorted(word_b); this correctly handles both case-sensitive and case-insensitive anagram checking.
Please revise
Hi Julia, Yvonne |
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
What did you learn from the changes you have made?
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
How were these changes tested?
A reference to a related issue in your repository (if applicable)
Checklist