forked from swaaz/basicprograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.py
More file actions
23 lines (19 loc) · 460 Bytes
/
program.py
File metadata and controls
23 lines (19 loc) · 460 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import datetime
start = datetime.datetime.now()
arr = [5, 8, 1, 3, 3, 0, 7, 4,5,8, 9, 10, 84, 34, 22]
arr_size = len(arr)
new_arr = [None]*(arr_size)
n = 0
for i in range(arr_size):
n=0
for j in range(arr_size):
if arr[i] > arr[j]:
n+=1
while new_arr[n] == arr[i]:
n+=1
new_arr[n] = arr[i]
arr = new_arr
for i in range(arr_size):
print ("%d" %arr[i]),
finish = datetime.datetime.now()
print (finish-start)