aboutsummaryrefslogtreecommitdiff
path: root/challenge-327/ysth/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-327/ysth/python/ch-1.py')
-rw-r--r--challenge-327/ysth/python/ch-1.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-327/ysth/python/ch-1.py b/challenge-327/ysth/python/ch-1.py
new file mode 100644
index 0000000000..fb86665466
--- /dev/null
+++ b/challenge-327/ysth/python/ch-1.py
@@ -0,0 +1,11 @@
+import sys
+from bitarray import bitarray
+
+ints = [ int(i) for i in sys.argv[1:] ];
+
+a = bitarray(len(ints)+1)
+for i in ints:
+ if 0 < i <= len(ints):
+ a[i] = 1
+# find 0 bits, starting at index 1
+print(list(a.search(0, 1)))