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 4
Kirill L.
  • 14.3k
  • 2
  • 17
  • 54

Ruby, 97 bytes

m=$<.lines.map{|l|l.chomp.size}.sort;r=[*1..s=m.
size];p s<2?4:m[0]==m[-1]? s==m[0]?1:2:r==m ?3:4

Try it online!

Output:

  1. Square
  2. Rectangle
  3. Triangle
  4. Mess
Kirill L.
  • 14.3k
  • 2
  • 17
  • 54

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