79562883

Date: 2025-04-08 19:18:14
Score: 1
Natty:
Report link

From what I can gather your solution works like this:

1. Get a comment that has a name in it.

2. Check if the comment has something from the blacklist in it

3. If it does discard the comment, if it doesn't surface the comment.

To avoid discarding valid comments with a blacklisted word in it, you would need to change your logic for discarding comments.

One way I can think of to try to fix this is to run a check like this for each comment with a blacklisted word:
If it has a blacklisted word, make a temporary version of the comment with the blacklisted word removed and see if there is any other instances of that name and repeat until either there is a valid name or you can safely discard the comment.

Example:

Checking: "Nancy was helpful during my pregnancy"

Then you would check-> "Nancy was helpful during my" [Good comment]

Checking: "Peanut butter was helpful during my pregnancy"

Then you would check-> "Peanut butter was helpful during my" [Discard this comment]

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Maxwell