Create a function that given a list, it returns the index where if split in two-subarrays (last element of the first array has index of (foundIndex-1)), the sum of them are equal.
twins([10, 20, 30, 5, 40, 50, 40, 15]) β 5
# foundIndex 5 : [10+20+30+5+40]=[50+40+15]
twins([1, 2, 3, 4, 5, 5]) β 4
# [1, 2, 3, 4] [5, 5]
twins([3, 3]) β 1
Return only the foundIndex, not the divided list.