! I was trying to solve the SPOJ NOSQ problem and I find this solution which I am not able to understand like what does contains do? and how does it shows output from cout.