summaryrefslogtreecommitdiffstats
path: root/2.1.py
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2020-10-21 17:55:31 +0300
committergramanas <anastasis.gramm2@gmail.com>2020-10-21 17:55:31 +0300
commit13f4b8278fc724965068b7c4fe339c5b8770c51b (patch)
tree0cdaecf41a35c699aee31d91fa159663772dee1f /2.1.py
parentf538e38f9499bcc93bc26a690ef1b8f1adfd811b (diff)
downloadfoobar-withgoogle-13f4b8278fc724965068b7c4fe339c5b8770c51b.tar.gz
foobar-withgoogle-13f4b8278fc724965068b7c4fe339c5b8770c51b.tar.bz2
foobar-withgoogle-13f4b8278fc724965068b7c4fe339c5b8770c51b.zip
Small fixes
Diffstat (limited to '2.1.py')
-rw-r--r--2.1.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/2.1.py b/2.1.py
index 43896d6..63e4a99 100644
--- a/2.1.py
+++ b/2.1.py
@@ -1,4 +1,4 @@
-#!/usr/bin/pytnon2
+#!/usr/bin/python2
## You are given a list of "pegs" with their location (positive integers, asc order).
## these pegs can accept gears with radius > 1
@@ -9,7 +9,7 @@
from fractions import gcd
from functools import reduce
-# test
+# for tests
from random import seed
from random import random
@@ -45,6 +45,13 @@ def solution(pegs):
return [-1, -1]
return [r1, 1]
+
+
+# test cases provided
+print(solution([4,30,50])) # [12, 1]
+print(solution([4,17,50])) # [-1, -1]
+
+# tests
seed(1)
def ran():