Array of hash: return or remove element with duplicate value

Hello,

Input:

a = [{:scan_name=>“cse”, :ip=>" 12"}, {:scan_name=>“e”, :ip=>“18”},
{:scan_name=>“df”, :ip=>“18”}]

Output:

b = [ {:scan_name=>“e”, :ip=>“18”}, {:scan_name=>“df”, :ip=>“18”}]

  1. Input

a = [{:scan_name=>“cse”, :ip=>" 12"}, {:scan_name=>“e”, :ip=>“18”},
{:scan_name=>“df”, :ip=>“18”}]

Output:

b = [ {:scan_name=>“cse”, :ip=>" 12"}]

Please help me. Thx