Created
March 1, 2019 00:50
-
-
Save antonioFlavio/d172cc4beae4c5786a8dea785a97ec6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for numero in iter(input, ""): | |
quantidade_num_telefones = int(numero) | |
matriz = [list(str(input())) for __ in range(quantidade_num_telefones)] | |
quantidade_digitos_nao_impressos = 0 | |
# A primeira linha é a base. Não precisa ser analisada. | |
for indice_numero_telefone in range(1, len(matriz)): | |
lista_digitos_telefone = matriz[indice_numero_telefone] | |
for indice_digito in range(len(lista_digitos_telefone)): | |
digito_numero_anterior = matriz[indice_numero_telefone-1][indice_digito] | |
if lista_digitos_telefone[indice_digito] == digito_numero_anterior: | |
quantidade_digitos_nao_impressos += 1 | |
else: | |
break | |
print(quantidade_digitos_nao_impressos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment