a = ['1.mp3', '2.aac', '3.wav']
b = ['1.flac', '3.flac']
a_filenames_mapping = Hash[a.map{ |x| [File.basename(x, File.extname(x)), x] }]
p a_filenames_mapping
b_filenames_mapping = Hash[b.map{ |x| [File.basename(x, File.extname(x)), x] }]
p b_filenames_mapping
differing_files = a_filenames_mapping.keys - b_filenames_mapping.keys
p differing_files
differing_filenames = differing_files.map{ |x| a_filenames_mapping[x] }
p differing_filenames
YSA9IFsnMS5tcDMnLCAnMi5hYWMnLCAnMy53YXYnXQpiID0gWycxLmZsYWMnLCAnMy5mbGFjJ10KCmFfZmlsZW5hbWVzX21hcHBpbmcgPSBIYXNoW2EubWFweyB8eHwgW0ZpbGUuYmFzZW5hbWUoeCwgRmlsZS5leHRuYW1lKHgpKSwgeF0gfV0KcCBhX2ZpbGVuYW1lc19tYXBwaW5nCgpiX2ZpbGVuYW1lc19tYXBwaW5nID0gSGFzaFtiLm1hcHsgfHh8IFtGaWxlLmJhc2VuYW1lKHgsIEZpbGUuZXh0bmFtZSh4KSksIHhdIH1dCnAgYl9maWxlbmFtZXNfbWFwcGluZwoKZGlmZmVyaW5nX2ZpbGVzID0gYV9maWxlbmFtZXNfbWFwcGluZy5rZXlzIC0gYl9maWxlbmFtZXNfbWFwcGluZy5rZXlzCnAgZGlmZmVyaW5nX2ZpbGVzCgpkaWZmZXJpbmdfZmlsZW5hbWVzID0gZGlmZmVyaW5nX2ZpbGVzLm1hcHsgfHh8IGFfZmlsZW5hbWVzX21hcHBpbmdbeF0gfQpwIGRpZmZlcmluZ19maWxlbmFtZXM=