Editorial for COCI '16 Contest 4 #2 Kartomat


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

First, we will input the given destinations in an array, and load the first couple of characters of the chosen destination into a special variable. For each destination that is already given and for each destination that we could have chosen, we check if it starts with this series of characters. If it does, we determine the letter that can be chosen in the next step, or, more precisely, the letter that follows after the given series of characters. Such obtained letter is appended to the previously chosen letters.

In the end, we replace each letter from the string ***ABCDEFGHIJKLMNOPQRSTUVWXYZ*** for which we haven't determined that it can be chosen in the next step with the character *. We are left with carefully printing the letters of the alphabet in blocks of 8 letters.


Comments

There are no comments at the moment.