Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def firstMns(n, a):
- for i in range(3):
- mn_val = a[3]
- mn_ind = n - 1
- for j in range(i, n):
- if a[j] < mn_val:
- mn_val = a[j]
- mn_ind = j
- for k in range(mn_ind - 1, i - 1, -1):
- a[k + 1] = a[k]
- a[i] = mn_val
- print(*a)
- firstMns(int(input()), list(map(int, input().split())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement