You are viewing a single comment's thread. Return to all comments →
My ruby vers. i used hashes
s,v = gets.strip.scan(/((\w)\2*)/).map(&:first), {} s.each{|a| a.scan(/\w/).each_with_index{|b,i| v[(('a'..'z').to_a.index(b)+1)*(i+1)] = 0}} gets.strip.to_i.times{puts v[gets.strip.to_i]!=nil ? "Yes" : "No"}
Seems like cookies are disabled on this browser, please enable them to open this website
Weighted Uniform Strings
You are viewing a single comment's thread. Return to all comments →
My ruby vers. i used hashes