From 8c13efe32288b5d8d4db6e90d606970e234e7df5 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 6 Dec 2023 10:22:05 +0100 Subject: [PATCH] d06 part one --- d06/run1.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 d06/run1.py diff --git a/d06/run1.py b/d06/run1.py new file mode 100644 index 0000000..4f00bb2 --- /dev/null +++ b/d06/run1.py @@ -0,0 +1,13 @@ +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)] + racesI=[(42,284), (68,1005), (69,1122), (85,1341)] + print(main(racesI)) \ No newline at end of file