From 9bf58c7cef71e4a84abbfe02c8d14a304fb3aae1 Mon Sep 17 00:00:00 2001 From: Freezed Date: Thu, 16 Jul 2020 09:40:40 +0200 Subject: [PATCH] Find id for pile center --- technical_tests/sand_grain_drop.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/technical_tests/sand_grain_drop.py b/technical_tests/sand_grain_drop.py index a7e2c16..93d5284 100644 --- a/technical_tests/sand_grain_drop.py +++ b/technical_tests/sand_grain_drop.py @@ -35,7 +35,9 @@ def main(pile, n): [[0, 1, 0, 1, 0], [1, 2, 2, 2, 1], [0, 2, 0, 2, 0], [1, 2, 2, 2, 1], [0, 1, 0, 1, 0]] """ - return pile + center = int((len(pile) - 1) / 2) + + return center if __name__ == "__main__":