Hackerrank Solution in C++ – StringStream

In C++, StringStream is a class that implements input and output operations on memory. It is useful in parsing different types of data. For example, it can be used to insert formatted data into a string. In addition, the method str() can be used to get the contents of an underlying string device.