RosettaCodeData/Task/Equilibrium-index/Perl-6/equilibrium-index-3.pl6
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

5 lines
254 B
Raku

# Original example, with expanded calculations:
0 1 2 3 4 5 6 # Index
-7 1 5 2 -4 3 0 # C (Value at index)
0 -7 -6 -1 1 -3 0 # L (Sum of left)
-7 -13 -7 0 -2 -3 0 # 2L+C