DEV Community

Discussion on: Python Programming Challenge

Collapse
 
subsr97 profile image
Subramanian 😎

How is this different from my second approach?

Collapse
 
idanarye profile image
Idan Arye

Now that I look at it - it isn't. I was probably not paying enough attention when I looked at your original post, and thought that you are calculating the entire products for each index...

The time complexity should be linear, and because every element can change the result you can't have sublinear complexity. So how did you exceed the time complexity? Are they timing the actual run instead of doing complexity analysis?

Thread Thread
 
subsr97 profile image
Subramanian 😎

Yes I think the actual run time is considered for timeout.

I'm unsure of what went wrong. That's why I wanted to discuss about this challenge. :)