Skip to content

Instantly share code, notes, and snippets.

@MaximeD
Forked from oelmekki/test
Created October 7, 2011 19:33
Show Gist options
  • Save MaximeD/1271170 to your computer and use it in GitHub Desktop.
Save MaximeD/1271170 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
array, places = [1,2,3,8,5,8,0,4], []
puts "Maximum value of array is #{array.max.to_s}"
array.each_with_index do |val,i|
places << i if val == array.max
end
puts "You can find #{array.max.to_s} in position #{places.join ', '}"
@oelmekki
Copy link

oelmekki commented Oct 7, 2011

ça c'est juste un fichier, hein :)

Mais t'inquiètes, je doute qu'on ait jamais quelque chose d'aussi gros à écrire que rails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment