Skip to content

Instantly share code, notes, and snippets.

@antonioFlavio
Created March 1, 2019 01:16
Show Gist options
  • Save antonioFlavio/9c2fa3bed3b6df334c7334eaa5cd120b to your computer and use it in GitHub Desktop.
Save antonioFlavio/9c2fa3bed3b6df334c7334eaa5cd120b to your computer and use it in GitHub Desktop.
def entrada():
try:
return input()
except EOFError:
return ""
for numero in iter(entrada, ""):
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