def problem8n(x): '''Quick, brute force implementation.''' candidates = [] xl = int_to_list(x) for i in range(0, len(xl) - 4): candidates.append(mul(xl[i:i + 5])) return max(candidates)
def problem8n(x): """Quick, brute force implementation.""" candidates = [] xl = int_to_list(x) for i in range(0, len(xl) - 4): candidates.append(mul(xl[i : i + 5])) return max(candidates)
def problem8(x): chunks = str(x).split('0') candidates = [0] for chunk in chunks: clen = len(chunk) if clen >= 5: for i in range(0, clen - 4): ints = [int(c) for c in chunk[i:i + 5]] candidates.append(mul(ints)) return max(candidates)
def problem8(x): chunks = str(x).split("0") candidates = [0] for chunk in chunks: clen = len(chunk) if clen >= 5: for i in range(0, clen - 4): ints = [int(c) for c in chunk[i : i + 5]] candidates.append(mul(ints)) return max(candidates)