Balanced sum

Design the function @suma_equilibrada(f)@ that, given a list of integers ff, returns the smallest index ii such that the sum of the elements of ff from the first position until the position ii is equal to the sum of the subsequent elements. Note that ii has to be a valid position in the list. If this position does not exist, the function will return -1.

Sample session

Problem information

Author: InfBesos

Generation: 2026-01-25T16:21:09.834Z

© Jutge.org, 2006–2026.
https://jutge.org