I have a hash and an array. I want to check whether an array element is in the hash as a key, and if not, delete the key from the hash.
RegionScoreHash={"A"=>1, "B"=>0, "C"=>0, "D"=>1, "E"=>0, "F"=>0, "G"=>0}
RegionsArray=["B", "C", "D", "E", "F"]
Result Required: Hash with elements present in array (A and G regions removed)
ResultHash={"B"=>0, "C"=>0, "D"=>1, "E"=>0, "F"=>0}