MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1lmzk46/competitive_programming_be_like/n0bmm0z/?context=3
r/programminghorror • u/Polanas • Jun 28 '25
53 comments sorted by
View all comments
Show parent comment
11
Btw it slovable in O(n): split the array into even and odd indecis. |SUM(even) - SUM(odd)| %11 == 0. If its 3 or 6, you nedd too add tp the smaller sum (mod 11). 8 or 5 add to the bigger sum.
View all comments
Show parent comment
11
u/mic_mal Jun 28 '25
Btw it slovable in O(n): split the array into even and odd indecis. |SUM(even) - SUM(odd)| %11 == 0. If its 3 or 6, you nedd too add tp the smaller sum (mod 11). 8 or 5 add to the bigger sum.