diff options
| author | Lubos Kolouch <lubos@kolouch.net> | 2022-02-17 19:03:53 +0100 |
|---|---|---|
| committer | Lubos Kolouch <lubos@kolouch.net> | 2022-02-17 19:03:53 +0100 |
| commit | 6a933e40878b068e5b069f94c3ae685f3d8769b7 (patch) | |
| tree | 5a48ca39cda774a0257927bf847aa8b837c42a8c /challenge-152/lubos-kolouch/python | |
| parent | cecb0a9230ee9b7152b708e5a9fa5a676c9735e5 (diff) | |
| download | perlweeklychallenge-club-6a933e40878b068e5b069f94c3ae685f3d8769b7.tar.gz perlweeklychallenge-club-6a933e40878b068e5b069f94c3ae685f3d8769b7.tar.bz2 perlweeklychallenge-club-6a933e40878b068e5b069f94c3ae685f3d8769b7.zip | |
Challenge 152 Task 1 LK Perl Python PHP
Diffstat (limited to 'challenge-152/lubos-kolouch/python')
| -rw-r--r-- | challenge-152/lubos-kolouch/python/ch-1.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/challenge-152/lubos-kolouch/python/ch-1.py b/challenge-152/lubos-kolouch/python/ch-1.py new file mode 100644 index 0000000000..6e170349ca --- /dev/null +++ b/challenge-152/lubos-kolouch/python/ch-1.py @@ -0,0 +1,22 @@ +""" Challenge 152 Task 1 """ + + +def get_min_count(in_arr: list): + """ Find out the lists minimum """ + + min_sum = 0 + + for sub_arr in in_arr: + + # so obviously it is not a tree, just independent arrays + # so I can just take a min from each row + + min_sum += min(sub_arr) + + return min_sum + + +assert get_min_count([[1], [5, 3], [2, 3, 4], [7, 1, 0, 2], [6, 4, 5, 2, + 8]]) == 8 +assert get_min_count([[5], [2, 3], [4, 1, 5], [0, 1, 2, 3], [7, 2, 4, 1, + 9]]) == 9 |
