This appears to be simple but I've been researching technical interview questions and there is one in particular on Glassdoor that I've yet to find a solution for. It's a loop that increments a character by one, but after Z, it converts to AA so it essentially becomes a string or concatenated characters. Similar to how scrolling right in Excel causes the alphabetical column names to contain more characters.
Essentially, it asks to build a string incrementer so that A + 1 = B... Z + 1 = AA, AA + 1 = AB... ZZ + 1 = AAA... and so forth.
While I understand that the characters increment by 1 because of the unicode behind the character, how can one make a loop that implicitly creates another character to add another letter AND increase it by one without making the original letter increase until the final character in the string reaches Z? An example being AZ going back to BA or BBZ going to BCA.
I feel like this could get limited because one would have to create a for loop and add a new array item for each new character they want to add after the loop reaches the condition (char < 'Z' again?)
Pseudocode would be appreciated but it can be explained in a particular language if preferred.