Miscellaneous solutions to problems in C++ found in hackerrank.com