Replace Nth Consonant
See the Image Source section at the very bottom of the page for the original problem statement ๐โโฌ ๐โ
In a world of letters, thereโs a secret mission hidden within a string of text. Your task is to find every nth consonant in the message and transform it into the next consonant in the alphabet, while preserving its original case. The journey of the consonants continues as 'b' becomes 'c', 'x' transforms into 'y', and when you reach 'z', it wraps back around to 'b' (or 'Z' to 'B'). Your goal is to follow this pattern, subtly shifting every nth consonant while leaving the rest of the message untouched, returning the newly crafted string when the job is done.
1Example 1
The consonants in "Codesignal" are "C-d-s-g-n-l". The third consonant is "s" which is replaced by "t". The sixth consonant is "l" which is replaced by "m". Thus, the resulting string is "CodeTignam".