Skip to main content
deleted 54 characters in body
Source Link
Kjetil S
  • 6.2k
  • 11
  • 23

Perl 5, 45 44 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)*0,@_} 

Try it online!

A translation of the JavaScript answer from @Arnauld. I'm at this point clueless to how and why this works.

Perl 5, 45 44 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)*0,@_} 

Try it online!

A translation of the JavaScript answer from @Arnauld. I'm at this point clueless to how and why this works.

Perl 5, 45 44 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)*0,@_} 

Try it online!

A translation of the JavaScript answer from @Arnauld.

added 1 character in body
Source Link
Kjetil S
  • 6.2k
  • 11
  • 23

Perl 5, 4545 44 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)-$n*0,@_} 

Try it online!Try it online!

A translation of the JavaScript answer from @Arnauld. I'm aat this point clueless to how and why this works.

Perl 5, 45 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)-$n,@_} 

Try it online!

A translation of the JavaScript answer from @Arnauld. I'm a this point clueless to how and why this works.

Perl 5, 45 44 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)*0,@_} 

Try it online!

A translation of the JavaScript answer from @Arnauld. I'm at this point clueless to how and why this works.

Post Undeleted by Kjetil S
Post Deleted by Kjetil S
Source Link
Kjetil S
  • 6.2k
  • 11
  • 23

Perl 5, 45 bytes

sub{$n=$q=1;!grep$_-$n|($n*=@_/$q++-1)-$n,@_} 

Try it online!

A translation of the JavaScript answer from @Arnauld. I'm a this point clueless to how and why this works.