Strange behaviour of std::map

Why does this submission pass while this one fails ?

The only difference in the codes is that in the correct submission I inserted in the map as


while in the 2nd one I inserted as :


and similarly for finding the index in the correct submission I used

			B[i] = m[s];

and in the incorrect submission I used :

			B[i] = m.find(s)->S;

So what is the cause of WA ? It has made me curious since quite a few days :frowning: