Skip to main content
Commonmark migration
Source Link

#Ruby 75

Ruby 75

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts STDIN.read.split(" ").permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.

#Ruby 75

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts STDIN.read.split(" ").permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.

Ruby 75

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts STDIN.read.split(" ").permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.

Consistency with other answers reading from standard input.
Source Link
user12166
user12166

#Ruby 5875

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts ARGVSTDIN.read.split(" ").permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.

#Ruby 58

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts ARGV.permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.

#Ruby 75

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts STDIN.read.split(" ").permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.

Source Link
user12166
user12166

#Ruby 58

Not my 'native' language, but one I thought I'd give a try at... thus this could (possibly) use some golfing tips. Still, not a bad entrant.

puts ARGV.permutation.map{|x|x.join}.sort.values_at(0,-1)

I wouldn't say it is elegant other that everything is built in to the language. It should be fairly obvious exactly how this works.