Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,8 @@
func eq_index(nums) {
var (i, sum, sums) = (0, 0, Hash.new);
nums.each { |n|
sums{2*sum + n} := [] -> append(i++);
sum += n;
}
sums{sum} \\ [];
}

View file

@ -0,0 +1,10 @@
var indices = [
[-7, 1, 5, 2,-4, 3, 0],
[2, 4, 6],
[2, 9, 2],
[1,-1, 1,-1, 1,-1, 1],
]
for x in indices {
say ("%s => %s" % @|[x, eq_index(x)].map{.dump});
}