#Create an array with 'size' rand numbers between 's_n' and 'e_n'
size=10
s_n=0
e_n=100
arr=Array.new(size){ rand(s_n..e_n) }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEAUTIFUL_STRINGS (Facebook Hacker Cup 2013 Hackathon) | |
File.open(ARGV[0]).each_line do |line| | |
next if line.chomp.empty? | |
single_word_character_statistic =[] | |
l=line.chomp | |
l.split.each_with_index do |v,i| | |
s_v=v.chars.sort { |x,y| x.downcase <=> y.downcase } |