Problem Analysis
This problem asks for the maximum product of any run of length consecutive digits inside a fixed 1000-digit number. The structure is a classic sliding window problem: I slide a window of fixed width across the sequence, compute a quantity — here the product of the digits — for each position, and track the best value seen. There is no number theory or combinatorics hidden here; the difficulty is purely about doing the obvious thing correctly while watching for two pitfalls: integer overflow and the presence of zero digits.
The search space is tiny. For a string of length N and a window of width L there are exactly N - L + 1 window positions, and each costs up to L multiplications, giving O(N · L) complexity — the product of input size and window width. With N = 1000 and L = 13 that is under 13,000 operations, effectively instantaneous, so a plain brute-force search over every window is entirely sufficient. The one structural fact worth exploiting is that any window containing the digit '0' has a product of zero, which can never beat a window of non-zero digits. The other thing I must reason about up front is the magnitude of the answer: thirteen nines multiply to 9^13 = 2,541,865,828,329, which exceeds the range of a 32-bit integer, so the accumulator must be at least 64 bits wide.
Solution Approach
Sliding-Window Scan (Python and C)
Both the Python and C solutions implement the same sliding window scan: visit every window position, compute its product, and keep the maximum. The two versions differ only idiomatically.
I store the 1000-digit number as a compile-time string constant in both languages — a Python str literal and a C static const char *. In C, adjacent string literals are concatenated by the compiler at no runtime cost, so I can break the number across many lines for readability while still producing one contiguous string. There is no I/O, no parsing, and no allocation for the data itself.
For each starting index i from 0 to N - length inclusive, the algorithm does two things. First it checks whether the window contains a '0', skipping it if so. Second, for surviving windows it multiplies the length digits together and updates the running best. In C I extract each digit with the idiom number[j] - '0', which converts an ASCII character to its numeric value because the C standard guarantees the digits '0' through '9' have consecutive codes. The product accumulator and the return type are both long long to hold the worst-case 9^13 safely.
The Python version expresses the same logic in a single generator expression: each window substring number[i:i+length] is produced lazily, a guard clause if "0" not in sequence filters out zero-containing windows, math.prod over (int(d) for d in sequence) computes each product, and the outer max(...) selects the largest. Python's arbitrary-precision integers mean overflow is never a concern, so no type reasoning is needed.
In both solutions the window length is a parameter rather than a hard-coded constant — read from argv in C and passed as a positional argument in Python. This lets the development case (length = 4, expected 5832) and the main case (length = 13, expected 23514624000) run against the same untouched source.