Regarding the search operation

in the video why does m[fruit] gives the value of the key as m is a pair and we should write m.second to get the value

Hi @aslesha.j7,
hashmap maps the key to value. so u can access value assigned to key using m[key]. But when u are iterating through map , u need to use i.first, i.second.
eg for(auto i:m){
u need to use i.first and i.second to access key and value
}
Also u cant just write m.second as m is a map data structure which contains a lot of keys mapped to values.
Hope dis helps.
If still something is unclear, post ur doubt here.