From 3acd1aa27ea68080f7732a0ad7066fd1cca3e2ea Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Mon, 30 Jan 2023 22:03:48 +0000 Subject: [PATCH] Removed unnecessary function --- 1ano/1semestre/fp/aula05/ex08.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/1ano/1semestre/fp/aula05/ex08.py b/1ano/1semestre/fp/aula05/ex08.py index ac0cb0e..46de941 100755 --- a/1ano/1semestre/fp/aula05/ex08.py +++ b/1ano/1semestre/fp/aula05/ex08.py @@ -32,18 +32,13 @@ def reapeatNumTimes(n): def positionOfFirstLargest(arr): - mx = maxArray(arr) - for index, a in enumerate(arr): - if a == mx: - return index - - -def maxArray(arr): mx = arr[0] - for a in arr: + index = 0 + for i, a in enumerate(arr): if a > mx: mx = a - return mx + index = i + return index if __name__ == "__main__":