fromcollectionsimportCounterdefprint_errors(colors:str)->str:color_tracker=Counter(colors)allowed_colors=range(ord('a'),ord('n'))# same as "ord('m') + 1"
color_errors=0forcolor,amountincolor_tracker.items():iford(color)notinallowed_colors:color_errors+=amountreturnf"{color_errors}/{len(colors)}"
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Python solution 🐍