The problem I'm trying to solve: given that you have two different lines consisting of lowercase letters from a to z, find the line between the two lines so that you can always find between the lines.
Additional Information:
Given that "a" precedes "b" in alphabetical order, there is an infinite number of lines between "a" and "b" when sorting like a dictionary would be: "aa", "aaa", "aaaa", 'ab', ' aba 'etc. However, there is no infinite number of lines between all lines - nothing happens between "a" and "aa". In addition, there is only one intermediate string 'aa' between 'a' and 'aaa'.
What is an algorithm that can find a string X that comes in alphabetical order between 'a' and 'b', which also satisfies the condition that there is an infinite number of lines between 'a' and X, as well as X and 'b'
algorithm
dave mankoff
source share