ROT13 Time : Space : 1234567891011121314#include <string>using namespace std;std::string rot13(const std::string& str) { string res = ""; auto work = [](int x) { return x < 13 ? x + 13 : x - 13; }; for(auto ch : str) { if(islower(ch)) res.push_back(work(ch-'a') + 'a'); else if(isalpha(ch)) res.push_back(work(ch-'A') + 'A'); else res.push_back(ch); } return res;}