암호를 찾으면 7자리씩 decoding하고 배열에 저장해 유효성 판단하고 값을 반환합니다. 따로 알고리즘이 필요한 문제는 아닙니다. for test in range(1, int(input()) + 1): N, M = map(int, input().split()) nums = {'0001101': 0, '0011001': 1, '0010011': 2, '0111101': 3, '0100011': 4, '0110001': 5, '0101111': 6, '0111011': 7, '0110111': 8, '0001011': 9} bits = [] for _ in range(N): a = input() idx = 0 if bits: continue while idx < M - 7: idx += 1 if a[idx..