If the value of m.count( hd)==1 which shows that there is already a value present in the map( at the same index) in that case we are pushing the value into the map or not? i am taking help from this code :-