Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Can you use brute force to check every number from 1 to n if any of them is the pivot integer?
If you know the sum of [1: pivot], how can you efficiently calculate the sum of the other parts?