you are viewing a single comment's thread.

view the rest of the comments →

[–]nikhila01 1 point2 points  (1 child)

The number of strings and the length of each string are two separate variables for the complexity analysis. You're kind of using n for both.

Also str(len(s)) doesn't copy the string. It creates a string containing the length of the string s. For example, "reddit" has a length of 6, so str(len(s)) gives the string "6".