Skip to content

Assignment 1#1

Open
HromovaAnna wants to merge 3 commits intomainfrom
assignment-1
Open

Assignment 1#1
HromovaAnna wants to merge 3 commits intomainfrom
assignment-1

Conversation

@HromovaAnna
Copy link
Copy Markdown
Owner

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

In this pull request, I am adding functionality to an existing anagram_checker function. Specifically, I am implementing two main features:

  1. Base Anagram Checker: A function that determines if two strings are anagrams of each other, ignoring case sensitivity.
  2. Expanded Functionality: An enhancement that adds a boolean parameter is_case_sensitive to the function. This parameter allows the function to handle case sensitivity based on user input.

What did you learn from the changes you have made?

I have learned that incorporating case sensitivity into an anagram checker can be achieved by adjusting the string normalization process based on a parameter. This change allows the function to be more flexible and adaptable to different use cases. The approach to solving the problem involves basic string manipulation techniques, including converting to lowercase, sorting, and comparing.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Initially, I considered using a different method to check for anagrams that involved counting character frequencies rather than sorting. While counting characters is efficient in some cases, sorting provides a straightforward and effective solution for this problem and ensures that the solution remains easy to understand and implement.

@HromovaAnna HromovaAnna closed this Sep 2, 2024
@HromovaAnna HromovaAnna reopened this Sep 2, 2024
Copy link
Copy Markdown

@dwz92 dwz92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your Part 1 is wrong but your part 2 is right. Please change your part 1 so that it passes the following tests:

anagram_checker("Slient", "listen") # True
anagram_checker("Slient", "Night") # False
anagram_checker("night", "Thing") # True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants