Strings and ASCII
And again a short post. Strings. It will be about letters and the ASCII code table.

Many string problems require searching for specific letter combinations.
Example 1
Ignoring the case of letters: let's say we want to work only with lower case
...
char letter = word[index];
if(letter < 97) letter += 32;
...If we have a string word containing letters of both cases, we extract the letter of interest and check its code letter < 97 and if the code is less than a character a (with code 97), we add to the code the difference between upper and lower case ( 'a' - 'A' = 32 )
Example 2
Conversion of digit character to digit :
...
char letter = '6';
int number = letter - '0';
...Example 3
It is often necessary to solve problems of counting the number of certain characters in a string. You can create your own hashtable based on an array of size 128 and then the code of each letter will coincide with the array index. Consider 3. Longest Substring Without Repeating Characters
int lengthOfLongestSubstring(string s) {
int n = s.size(),answer = 0;
int frec[128]={0};
for (int pos = 0, i = 0; pos < n; pos++) {
i = max(frec[s[pos]], i);
answer = max(answer, pos - i + 1);
frec[s[pos]] = pos + 1;
}
return answer;
}I hope these simple tips will improve your code. =)