How to Reverse Only Letters and Vowels in a String Using C++
Jul 11, 2024 · 3 min read · using namespace std; #include <iostream> #include <algorithm> #include <vector> string reverseOnlyLetters(string s) { int low = 0; int high = s.size() - 1; while (low < high) { if (isalpha(s[low]) && isalpha(s[high])) ...
Join discussion
