Skip to main content
added 149 characters in body
Source Link
Aiden Chow
  • 14.6k
  • 1
  • 22
  • 61

Desmos, 154 139139 137 bytes

Thanks @fireflame241 for helping me golf a couple of bytes (on Discord)

A=length(l)
B=[1...A-f]
Z=[0...A]
h(a,b)=\{\sum_{C=a}^bl[C]=0,0\}
f=\max((Z+1)\sign(\sum_{n=1}^{A-Zn=1+Z}h^Ah(n-Z,n+Zn)))
g(l)=[f,\max(Bh(B,[f...A]))]

99% sure thereUses Output Format #4. The first element in the outputted list is a better strategy to solving thisthe length of the subarray, but right now I don't see itwhile the second element is the starting index of the subarray in respect to the inputted array.

Try It On Desmos!Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)

Desmos, 154 139 bytes

A=length(l)
B=[1...A-f]
Z=[0...A]
h(a,b)=\{\sum_{C=a}^bl[C]=0,0\}
f=\max((Z+1)\sign(\sum_{n=1}^{A-Z}h(n,n+Z)))
g(l)=[f,\max(Bh(B,[f...A]))]

99% sure there is a better strategy to solving this, but right now I don't see it.

Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)

Desmos, 154 139 137 bytes

Thanks @fireflame241 for helping me golf a couple of bytes (on Discord)

A=length(l)
B=[1...A-f]
Z=[0...A]
h(a,b)=\{\sum_{C=a}^bl[C]=0,0\}
f=\max((Z+1)\sign(\sum_{n=1+Z}^Ah(n-Z,n)))
g(l)=[f,\max(Bh(B,[f...A]))]

Uses Output Format #4. The first element in the outputted list is the length of the subarray, while the second element is the starting index of the subarray in respect to the inputted array.

Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)

deleted 4 characters in body
Source Link
Aiden Chow
  • 14.6k
  • 1
  • 22
  • 61

Desmos, 154154 139 bytes

A=length(l)
B=[1...A-f]
Z=[0...A]
h(na,b)=\{n=0:1\sum_{C=a}^bl[C]=0,0\}
f=\max((Z+1)\sign(\sum_{n=1}^{A-Z}h(\sum_{k=n}^{n,n+Z}l[k])))
g(l)=[f,\max(Bh(\sum_{a=B}^{B,[f...A]}l[a]))]

99% sure there is a better strategy to solving this, but right now I don't see it.

Try It On Desmos!Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)

Desmos, 154 bytes

A=length(l)
B=[1...A-f]
Z=[0...A]
h(n)=\{n=0:1,0\}
f=\max((Z+1)\sign(\sum_{n=1}^{A-Z}h(\sum_{k=n}^{n+Z}l[k])))
g(l)=[f,\max(Bh(\sum_{a=B}^{[f...A]}l[a]))]

99% sure there is a better strategy to solving this, but right now I don't see it.

Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)

Desmos, 154 139 bytes

A=length(l)
B=[1...A-f]
Z=[0...A]
h(a,b)=\{\sum_{C=a}^bl[C]=0,0\}
f=\max((Z+1)\sign(\sum_{n=1}^{A-Z}h(n,n+Z)))
g(l)=[f,\max(Bh(B,[f...A]))]

99% sure there is a better strategy to solving this, but right now I don't see it.

Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)

Source Link
Aiden Chow
  • 14.6k
  • 1
  • 22
  • 61

Desmos, 154 bytes

A=length(l)
B=[1...A-f]
Z=[0...A]
h(n)=\{n=0:1,0\}
f=\max((Z+1)\sign(\sum_{n=1}^{A-Z}h(\sum_{k=n}^{n+Z}l[k])))
g(l)=[f,\max(Bh(\sum_{a=B}^{[f...A]}l[a]))]

99% sure there is a better strategy to solving this, but right now I don't see it.

Try It On Desmos!

Try It On Desmos! - Prettified(and a more verbose version)