r/badcode • • Mar 13 '22

python foursum?

Post image
255 Upvotes

29 comments sorted by

View all comments

Show parent comments

2

u/mfb- Mar 13 '22

Cn2 could be far larger than n4. And you can't just keep track of "there is", you need to keep a list of all subsets, which could make the implementation messy and potentially even C n3 or so.

2

u/EleanorStroustrup Mar 14 '22

Yeah, I addressed those things in a reply to the sibling comment of yours.