diff options
Diffstat (limited to 'challenge-183/sgreen/python/ch-1.py')
| -rwxr-xr-x | challenge-183/sgreen/python/ch-1.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/challenge-183/sgreen/python/ch-1.py b/challenge-183/sgreen/python/ch-1.py new file mode 100755 index 0000000000..64bd316ef4 --- /dev/null +++ b/challenge-183/sgreen/python/ch-1.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import sys +import yaml + + +def main(y): + array = yaml.safe_load(y) + + solution = [] + for i in range(len(array)): + + # See if we have found this list before + is_unique = True + for j in range(i): + if array[i] == array[j]: + is_unique = False + break + + if is_unique: + # We haven't. Add it to the solutions + solution.append(array[i]) + + print(*solution, sep=', ') + + +if __name__ == '__main__': + main(sys.argv[1]) |
