C++ Strings and Array Solutions