Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Perl6 - 47

for 1..10**6 {(1 x$_)~~/^(11+?)$0+$/ or say $_}

credit to Gowtham's perl solutionGowtham's perl solution

  • 1000000 better written as 10**6
  • print "$_\n" became say $_
  • =~ became ~~
  • needed to add whitespace in front of the x operator

Perl6 - 47

for 1..10**6 {(1 x$_)~~/^(11+?)$0+$/ or say $_}

credit to Gowtham's perl solution

  • 1000000 better written as 10**6
  • print "$_\n" became say $_
  • =~ became ~~
  • needed to add whitespace in front of the x operator

Perl6 - 47

for 1..10**6 {(1 x$_)~~/^(11+?)$0+$/ or say $_}

credit to Gowtham's perl solution

  • 1000000 better written as 10**6
  • print "$_\n" became say $_
  • =~ became ~~
  • needed to add whitespace in front of the x operator
Source Link
pabo
  • 111
  • 2

Perl6 - 47

for 1..10**6 {(1 x$_)~~/^(11+?)$0+$/ or say $_}

credit to Gowtham's perl solution

  • 1000000 better written as 10**6
  • print "$_\n" became say $_
  • =~ became ~~
  • needed to add whitespace in front of the x operator