From 3363ae885ba8ce92b15c536a8a3464961ce751ce Mon Sep 17 00:00:00 2001 From: JESTIN <108663132+Jeztyn@users.noreply.github.com> Date: Mon, 24 Oct 2022 19:09:10 +0530 Subject: [PATCH] Pokemon_training_game.py Pokemon training game using python --- Python/Pokemon_training_game.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Python/Pokemon_training_game.py diff --git a/Python/Pokemon_training_game.py b/Python/Pokemon_training_game.py new file mode 100644 index 0000000..4f0315d --- /dev/null +++ b/Python/Pokemon_training_game.py @@ -0,0 +1,15 @@ +# python code to train pokemon +powers = [3, 8, 9, 7] + +mini, maxi = 0, 0 + +for power in powers: + if mini == 0 and maxi == 0: + mini, maxi = powers[0], powers[0] + print(mini, maxi) + else: + mini = min(mini, power) + maxi = max(maxi, power) + print(mini, maxi) + +# Time Complexity is O(N) with Space Complexity O(1)