StringStream

I took a look at the StringStream HackerRank challenge. There are two items that one needs to deal with. The first is to parse the coma separated string of integers after it has been assigned to a string stream as suggested by the challenge. Of course one could solve this challenge just parsing the string directly. The second task is to allocate a vector in which to return the integers. At first I just allocated an empty array which I resized each time a new integer had to be inserted. In my final approach I just determined the number of integers by counting the ‘,’s in the string. Continue reading “StringStream”