From ef2722ae3b1576fd6b67452e7e466231d7d8844e Mon Sep 17 00:00:00 2001 From: saahil1292 Date: Thu, 15 Jun 2017 16:02:37 +0000 Subject: [PATCH 1/4] Done --- .results.json | 1 + build.py | 8 ++++---- build.pyc | Bin 0 -> 493 bytes tests/__init__.pyc | Bin 0 -> 163 bytes tests/test_solution.pyc | Bin 0 -> 847 bytes 5 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .results.json create mode 100644 build.pyc create mode 100644 tests/__init__.pyc create mode 100644 tests/test_solution.pyc diff --git a/.results.json b/.results.json new file mode 100644 index 0000000..1d2353b --- /dev/null +++ b/.results.json @@ -0,0 +1 @@ +{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.0003879070281982422}]} \ No newline at end of file diff --git a/build.py b/build.py index 6d455db..b219408 100644 --- a/build.py +++ b/build.py @@ -1,9 +1,9 @@ def solution(list): - ''' - Enter your code here - ''' unique = [] for x in list: if x not in unique: unique.append(x) - return (unique) \ No newline at end of file + return (unique) + +l = [1, 2, 3, 2, 1, 5, 6, 5, 5, 5] +solution(l) diff --git a/build.pyc b/build.pyc new file mode 100644 index 0000000000000000000000000000000000000000..22eeaffa2d6113eb4cfc64383164e4eeddb34588 GIT binary patch literal 493 zcmb`D&q@O^5XQghpRE@6<`amAMW{=QAfkv^&pp^fvEX6d#5Q)j**00I(4G`u$A|L; zoCyVAz%cX6$0V8gNb@J|etq9R<=C$-?{}Q;nxTMCV9J7^8c@wZ)-9-ZAd41eT}%lY z(1Z^HsR-kw!|!uqH1|2=-CZ(fz>csv!xngWKEbYmEeB!I!8#W42B}D^RSb>^*T#u7 z8wL7^WmZ+XREf0rEkUspDL#tT;H~)c_WuTNmR8k;z6}Ot$Ysl_G5 h`tk9Zd6^~g@p?ct96$qYa`RJ4b5iX<))oUX0{|_oCKdny literal 0 HcmV?d00001 diff --git a/tests/test_solution.pyc b/tests/test_solution.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89504f956ec71fe1da81110e1993a7166705dba7 GIT binary patch literal 847 zcmcIiO-sW-5S>lhD5VAc4<3S0LyH$dMD#A03esLe>~7m=J|wd_2<@r<9RHm^K;LX@ z3*H+tFSEOEXWrYa|K006f8C9zw0(ShZxMVB(0CQ)M1`V>BBebtie`$mPoG3;2wRCTUsUL}L*xPJBZo)=ns;dB(NfXUqqU-yPfMa#%z(Mu=(fz;wDwSr z;7BYy{IkSc2brkKJON+8xet(qGPE*$X|i0$La`z}Wj3{asv8rE8!NyjpKTaYF1J#k zHr(VkL`Dwy5m~gT3KMafF0yC{BiN}FiLnoa-x!!D|_k51XVEKF(p zgUiU`C$PihPy7XlJyeyY-K0onu}td3J5yb?aUwHGQl^DT66YgHib^**hOw+Uje9tZ q+W7AdupDQg9`@RrGPB|%#sWFsUX05QqsZOw>&;2rh&re2#Qz0tAiU22 literal 0 HcmV?d00001 From 4894e6e1734b505ecf0342196e5569e84ae1eb47 Mon Sep 17 00:00:00 2001 From: saahil1292 Date: Thu, 15 Jun 2017 16:07:43 +0000 Subject: [PATCH 2/4] Done --- .results.json | 2 +- build.pyc | Bin 493 -> 493 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.results.json b/.results.json index 1d2353b..072e9f7 100644 --- a/.results.json +++ b/.results.json @@ -1 +1 @@ -{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.0003879070281982422}]} \ No newline at end of file +{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.0003821849822998047}]} \ No newline at end of file diff --git a/build.pyc b/build.pyc index 22eeaffa2d6113eb4cfc64383164e4eeddb34588..dddabcea1581e3773f477ce374de18d1e467066d 100644 GIT binary patch delta 15 XcmaFM{Fa%G`7 Date: Thu, 15 Jun 2017 16:12:20 +0000 Subject: [PATCH 3/4] Done --- .results.json | 2 +- build.py | 2 +- build.pyc | Bin 493 -> 473 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.results.json b/.results.json index 072e9f7..d13cecf 100644 --- a/.results.json +++ b/.results.json @@ -1 +1 @@ -{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.0003821849822998047}]} \ No newline at end of file +{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.00036787986755371094}]} \ No newline at end of file diff --git a/build.py b/build.py index b219408..5d61c71 100644 --- a/build.py +++ b/build.py @@ -5,5 +5,5 @@ def solution(list): unique.append(x) return (unique) -l = [1, 2, 3, 2, 1, 5, 6, 5, 5, 5] +l = [1, 3, 4, 3 ,5] solution(l) diff --git a/build.pyc b/build.pyc index dddabcea1581e3773f477ce374de18d1e467066d..511493db34f5fb0b4c37fa77a26f3fb523d746d0 100644 GIT binary patch delta 82 zcmaFMe3Mz4`7 Date: Thu, 15 Jun 2017 16:17:52 +0000 Subject: [PATCH 4/4] Done --- .results.json | 2 +- build.py | 9 ++++++--- build.pyc | Bin 473 -> 549 bytes 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.results.json b/.results.json index d13cecf..d29f727 100644 --- a/.results.json +++ b/.results.json @@ -1 +1 @@ -{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.00036787986755371094}]} \ No newline at end of file +{"stats": {"passes": 1, "skipped": 0, "encoding": "UTF-8", "errors": 0, "failures": 0, "total": 1}, "results": [{"classname": "tests.test_solution:TestSolution", "type": "success", "name": "test_solution", "time": 0.0005080699920654297}]} \ No newline at end of file diff --git a/build.py b/build.py index 5d61c71..adc0eaf 100644 --- a/build.py +++ b/build.py @@ -1,9 +1,12 @@ def solution(list): unique = [] + seen = set() for x in list: - if x not in unique: - unique.append(x) - return (unique) + if x not in seen: + seen.add(x) + for y in seen: + unique.append(y) + return unique l = [1, 3, 4, 3 ,5] solution(l) diff --git a/build.pyc b/build.pyc index 511493db34f5fb0b4c37fa77a26f3fb523d746d0..af92602310f2a239a518ba62f8d14a3f78c8aaa9 100644 GIT binary patch delta 271 zcmXAjK}y6x5Ji8bGf{&9MGb;GS7BD(Az5cJF0zU;kVZO6m@yqD1080O6NEX#oWPT~ z^c-Hmst8q&-@l7r^`lOHpnjw9{%Z>I!vcWfPPy9`#v3pYEHJY0&@bVDtbD|v;J7@z zpW!nWQIj|$fwnQYivB_Dth~YC!x3r^&i@}sQLyox5UtL-e-Rb>M<)|-uP zszlDRKI6l*cK+xZv+eZkwOTh;g8G^J>AQNm;wLDe3ySEHZkg9)WX8xEBT+^|^TcDW M&X2FOQ{f%`0Z^MQ8vpSqvbNW=00aLS6YcK-!`hm$3HXt*xpdd9bMFV7X2@8