Skip to main content
added 34 characters in body
Source Link
Asone Tuhid
  • 2.4k
  • 8
  • 22

#Ruby 8989 79 bytes -10 bytes thanks to Unihedron

->m{n=m.map &:dup;3n=m;3.times{n=n.zip(m=m.transpose.reverse).map{|i,j|i.zip(j).map &:sum}};n}

Try it online!Try it online!

#Ruby 89 bytes

->m{n=m.map &:dup;3.times{n=n.zip(m=m.transpose.reverse).map{|i,j|i.zip(j).map &:sum}};n}

Try it online!

#Ruby 89 79 bytes -10 bytes thanks to Unihedron

->m{n=m;3.times{n=n.zip(m=m.transpose.reverse).map{|i,j|i.zip(j).map &:sum}};n}

Try it online!

Source Link
Asone Tuhid
  • 2.4k
  • 8
  • 22

#Ruby 89 bytes

->m{n=m.map &:dup;3.times{n=n.zip(m=m.transpose.reverse).map{|i,j|i.zip(j).map &:sum}};n}

Try it online!