We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5317b1 commit b5803e8Copy full SHA for b5803e8
Day1/nql.py
Day1/part1.py
@@ -0,0 +1,13 @@
1
+def part1( fname ):
2
+ inputfile = open(fname)
3
+ line = inputfile.readline()
4
+ inputfile.close()
5
+ floor = 0
6
+ for x in line:
7
+ if x == '(':
8
+ floor += 1
9
+ elif x == ')':
10
+ floor -= 1
11
+ return floor
12
+
13
+print(part1("input"))
Day1/part2.py
@@ -0,0 +1,17 @@
+def part2( fname ):
+ pos = 0
+ pos += 1
+ if floor < 0:
14
+ break
15
+ return pos
16
17
+print(part2("input"))
0 commit comments