This is from a solution I saw at a competitive programming site:
gets.split.map &:to_i
The &:to_i
phrase seems to be equivalent to {|s| s.to_i}
, but I can't find anything about that syntax at ruby-doc.org, or a match for "&:" [ruby] here. (I don't know what to call it for an English language search, either.)
If it matters, that site is using Ruby 3.0.1.