Hash MethodsAdd a record:#[116] pry(main)> map = {}=> {} [117] pry(main)> map['first'] = 1=> 1 [118] pry(main)> map=> {"first"=>1}CopyGet a record:#[120] pry(main)> map['first']=> 1CopyCheck if contains key#[109] pry(main)> temp=> {:third_message=>"this is third message", :fourth_message=>"this is a fourth message"} # With has_key?[110] pry(main)> temp.has_key?(:second_message)=> false [111] pry(main)> temp.has_key?(:third_message)=> true # With key?[6] pry(main)> temp.key?(:second_message)=> false [7] pry(main)> temp.key?(:third_message)=> trueCopyDelete a record:#[102] pry(main)> temp=> {:first_message=>"this is a message", :third_message=>"this is third message", :fourth_message=>"this is a fourth message"} [103] pry(main)> temp.delete(:first_message)=> "this is a message" [104] pry(main)> temp=> {:third_message=>"this is third message", :fourth_message=>"this is a fourth message"}CopyDelete all records#temp.clearCopyGet the length#temp.lengthCopyAccess keys:#[100] pry(main)> temp.keys=> [:first_message, :third_message, :fourth_message]CopyAccess values:#[101] pry(main)> temp.values=> ["this is a message", "this is third message", "this is a fourth message"]CopyResources:#https://www.shortcutfoo.com/app/dojos/ruby-hashes/cheatsheetRelated leetcode problem:#https://leetcode.com/problems/two-sum/