From 0e708c284a29501e7a0bb8a1780aa29056105aa9 Mon Sep 17 00:00:00 2001 From: Moria Date: Wed, 14 Oct 2015 21:05:23 -0400 Subject: [PATCH] Forgot to check for length > 1000 --- centerstar.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/centerstar.py b/centerstar.py index f130978..cef0ae1 100644 --- a/centerstar.py +++ b/centerstar.py @@ -138,7 +138,8 @@ def main(): n = int(content[0].strip()) S = [s.strip() for s in content[1:]] # Dont forget to strip newlines and such - + if len(S[0]) > 1000: + sys.exit() # Init scoring table to find center string candidate scores = [0 for i in range(n)]