I have a question concerning pset2, SUBSTITUTION. I finalized the 3 initial filters of this problem:
- character count
- argument count
- non-alphabetical characters.
now I'm moving to the fourth condition to sort out of potential keys.
Could there be more than 1 way to check for repeat characters in the key? Could this be correct?
so far I have thought of 2 different ways.
Both techniques involve converting the individual elements to ascii codes and then comparing the ascii codes in pairs.
a. Use a particular element of the array as an anchor and compare it against the other 25 elements in the key. If nothing happens, repeat the cycle for a different anchor element until all 26 elements are used as anchors.
b. Use a character from the alphabet and look for it within the key. If it appears more than once, that's a trigger to stop the operation, use printf to let the user know there is a repeat element. If nothing happens, use another letter from the alphabet, repeat the verification.
thank you for any input,