Skip to content

Commit 9fd50ea

Browse files
committed
added few more comment
1 parent 56038bf commit 9fd50ea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Arrays/three_largest_no.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ def three_max_no(arr:list)-> list:
2424
# we will iterate through the array and compare the values
2525
for i in arr:
2626
if i > max_1:
27+
# if the value is greater than the first variable, we will update the variables
2728
max_1,max_2,max_3 = i, max_1, max_2
2829
elif i > max_2:
30+
# if the value is greater than the second variable, we will update the variables
2931
max_2, max_3 = i, max_2
3032
elif i > max_3:
33+
# if the value is greater than the third variable, we will update the variables
3134
max_3 = i
3235
# return the three max values as a sorted array
3336
return [max_1, max_2, max_3]

0 commit comments

Comments
 (0)