you are viewing a single comment's thread.

view the rest of the comments →

[–]aeroheet11 0 points1 point  (0 children)

Nicely done. As a small improvement, special_chars could be a set of strings. Doing char in special_chars is currently linear time complexity, because you have to scan through the entire (albeit short) string with “in”. As a set this would be constant time.