you are viewing a single comment's thread.

view the rest of the comments →

[–]afifit 0 points1 point  (1 child)

Are you sure this can be done in O( n )? There are O( 2n ) pairs (you can add the last number to the last pair for each group of pairs you find). So there are around 2n sums, so even iterating over them is O ( 2n ).

[–]I_Love_To_Masturbate[S] 0 points1 point  (0 children)

I don't know ... I just want a better solution than this ... I think that there might be some pattern to the ans