From 4884b22b53b03422bfd819bc0c81ac943f8ed333 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 6 Dec 2023 10:26:40 +0100 Subject: [PATCH] d06 part one and two --- d06/run.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 d06/run.py diff --git a/d06/run.py b/d06/run.py new file mode 100644 index 0000000..63efebc --- /dev/null +++ b/d06/run.py @@ -0,0 +1,15 @@ +def main(races, S=1): + for t, d in races: + result = [] + for h in range(0, t+1): + if (h * (t-h)) > d: result.append(h) + S *= len(result) + return S + + +if __name__ == '__main__': + races=[(7,9), (15,40), (30,200)] + races2=[(71530,940200)] + racesI=[(42,284), (68,1005), (69,1122), (85,1341)] + racesI2=[(42686985,284100511221341)] + print(main(racesI2)) \ No newline at end of file