I have to write a program that will decode a Ceasar cypher with any possible rotation length on a long string that will be imported into the program. I'm trying to figure out some pseudo coding on how I want to tackle this problem but there is one key thing that I cannot figure out.
I have no clue how to go about writing a function that will find the largest occurrence of a letter in a string, and use that percentage of occurrence to find the amount shifted from a standard percentage of letter usage in the English language.
Essentially what I want to do is find the most used letter in the string, then find the difference between the encoded string max used letter and a constant given, to find my rotation key. Then use that key to decode the string.
Any help with ideas of possible ways to create a function that will count the occurrence of letters in a string will be big step forward as I go on writing the rest of my program.