You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
smol_scriptz/match.rb

19 lines
310 B

# frozen_string_literal: true
ids = []
titles = []
res = []
File.open('ids.txt').each do |line|
ids << line
end
File.open('titles.txt').each do |t|
titles << t
end
ids.each do |id|
titles.each do |title|
res << "#{id}-#{title}" if ids.find_index(id) == titles.find_index(title)
end
end
puts res