Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 3
G B
  • 23.4k
  • 1
  • 24
  • 55

Ruby, 64 bytes

->w,h{[*1..w].product([*1..h]).sort_by{|a,b|[q=a+b,[b,a][q%2]]}}

Try it online!

G B
  • 23.4k
  • 1
  • 24
  • 55

AltStyle によって変換されたページ (->オリジナル) /