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 Answer

added 94 characters in body
Source Link
Value Ink
  • 13.5k
  • 1
  • 18
  • 46

Ruby, 105(削除) 105 (削除ここまで) 129 bytes

+24 bytes because I missed part of the spec

->a{a.map{|e|i=a|e|l=e[r=/\S+$/];i=a.count{|n|n[/\S+/]==e[/\S+$/]]==l};e+"#{' definitely'if i>1i>a.count{|n|n[r]==l}} has two first names"if i>0}-[p]}

Try it online! Try it online!

Ruby, 105 bytes

->a{a.map{|e|i=a.count{|n|n[/\S+/]==e[/\S+$/]};e+"#{' definitely'if i>1} has two first names"if i>0}-[p]}

Try it online!

Ruby, (削除) 105 (削除ここまで) 129 bytes

+24 bytes because I missed part of the spec

->a{a.map{|e|l=e[r=/\S+$/];i=a.count{|n|n[/\S+/]==l};e+"#{' definitely'if i>a.count{|n|n[r]==l}} has two first names"if i>0}-[p]}

Try it online!

Source Link
Value Ink
  • 13.5k
  • 1
  • 18
  • 46

Ruby, 105 bytes

->a{a.map{|e|i=a.count{|n|n[/\S+/]==e[/\S+$/]};e+"#{' definitely'if i>1} has two first names"if i>0}-[p]}

Try it online!

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