Here we have an array of hashes. How can we keep only the hashes for which at least one key is contained in an array?
# array of hashes
@arr_of_h = [{first: 10},
{second: 10, secondB: 10},
{third: 10, thirdB: 10}]
# array
arr = ["first", "third"]
Desired output
@output = [{:first=>10}, {:third=>10, :thirdB=>10}]