From eeea9321efdf2ce6141a9f6c4501a42db478122a Mon Sep 17 00:00:00 2001 From: Amanda Bertsch <42593540+abertsch72@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:40:22 -0700 Subject: [PATCH 1/3] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c1b7b34b..aeb0c6ba 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -439,3 +439,8 @@ Name: [Antonio](https://github.com/toluwalope19)
Place: Nigeria
Coding Experience: Python and javaScript.
Email: tolubarca01@gmail.com
+ +Name: [Amanda Bertsch](https://github.com/abertsch72)
+Place: Arizona, USA
+Coding Experience: Python, C, Java, SQL.
+Email: abertsch72@gmail.com
From 42881046f0a007b9a8e2cf2b1c65f7d081d457c7 Mon Sep 17 00:00:00 2001 From: Amanda Bertsch <42593540+abertsch72@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:42:32 -0700 Subject: [PATCH 2/3] find unique strings in doubly nested list --- python/unique/abertsch72_unique_strings_in_nested_lists.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 python/unique/abertsch72_unique_strings_in_nested_lists.py diff --git a/python/unique/abertsch72_unique_strings_in_nested_lists.py b/python/unique/abertsch72_unique_strings_in_nested_lists.py new file mode 100644 index 00000000..8d547dc4 --- /dev/null +++ b/python/unique/abertsch72_unique_strings_in_nested_lists.py @@ -0,0 +1,6 @@ +seqs = [["a","b","c"],["a","d","e","f"],["y","a"],["a","a","a","a"], ["A"]] + +print(len(set([name for seq in seqs for name in seq]))) + + +assert (len(set([name for seq in seqs for name in seq])) == 8) \ No newline at end of file From c93f0d9d192a17ca821c32f25931443b0d7aefea Mon Sep 17 00:00:00 2001 From: Amanda Bertsch <42593540+abertsch72@users.noreply.github.com> Date: Tue, 22 Oct 2019 13:45:54 -0700 Subject: [PATCH 3/3] test won't fail if seqs is changed --- python/unique/abertsch72_unique_strings_in_nested_lists.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/unique/abertsch72_unique_strings_in_nested_lists.py b/python/unique/abertsch72_unique_strings_in_nested_lists.py index 8d547dc4..8ff364a7 100644 --- a/python/unique/abertsch72_unique_strings_in_nested_lists.py +++ b/python/unique/abertsch72_unique_strings_in_nested_lists.py @@ -2,5 +2,6 @@ print(len(set([name for seq in seqs for name in seq]))) - -assert (len(set([name for seq in seqs for name in seq])) == 8) \ No newline at end of file +# Testing +testseqs = [["a","b","c"],["a","d","e","f"],["y","a"],["a","a","a","a"], ["A"]] +assert (len(set([name for seq in testseqs for name in seq])) == 8)