HackerRank Problem : Reverse and capitalise first alphabet of each word.
Problem : ( Link : Click here to visit this problem on HackerRank. ) Reverse the words in a string and capitalize the first letter of each reversed word, preserving the capitalization in the original stri. For eg: "Hello World" would be transformed to "OlleH DlroW". Input : The first line of input would be the number of test cases followed by each string in a line. Output : Output should be the string with each word reversed and first letter of each reversed word capitalized. Each output string should be printed to a new line. Sample Input Sample Output 1 Hello World OlleH DlroW ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Solution : ( in C++ ) #include <iostream> #include <string> #include <algorithm> #include <cctype> using namespace std ...
Comments
Post a Comment