fork(1) download
  1. @(x,y)find((v=((z=cumsum(x.^2))(y:end)-[0,z(1:end-y)]))==max(v),1)-1
Success #stdin #stdout 0.21s 103360KB
stdin
Standard input is empty
stdout
ans =

@(x, y) find ((v = ((z = cumsum (x .^ 2)) (y:end) - [0, z(1:end - y)])) == max (v), 1) - 1