Hi, for the 'flip' problem, my code works for all my test cases, but I get a run-error when submitting.
I have also fuzzed it with a large number of random test cases for all row lengths, and column lengths, and the program still succeeds with no exception.
Is there any chance we can have access to additional test cases to debug our algorithms? Because I' not sure what to do after fuzzing the possible inputs so thoroughly.
Here is the fuzzing script I'm using to test for runtime errors:
import subprocess
import os
import random
import time
filename = "flip.py"
fuzz_runs = 1000
path = os.getcwd()
file_path = os.path.join(path, filename)
while fuzz_runs > 0:
rows = 1 + int(999 * random.random())
cols = 1 + int(999 * random.random())
values = [["." if random.random() < 0.5 else "x" for c in range(cols)] for r in range(rows)]
grid_lines = "\n".join("".join(values[r]) for r in range(rows))
question = f"{rows} {cols}\n{grid_lines}"
with open("test/22.in", 'w') as f:
f.write(question)
result = subprocess.run(['python3', file_path], input=question, capture_output=True, text=True, check=False)
if result.stderr:
print(result.stderr)
else:
print(result.stdout)
fuzz_runs -= 1