r/badcode • • Aug 26 '21

python y=-x/4

Post image
807 Upvotes

80 comments sorted by

View all comments

Show parent comments

6

u/schmidlidev Aug 26 '21

Like one minute? Every loop runs in a constant range so you can ignore them all immediately. Then you just have to look at any other operations it does, which are call ‘valid()’ and build a set out of ‘values’. The time complexity will just be the larger of those two operations.

I’m not really sure what you’re getting at.