Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def countSort(arr):
- aux = []
- for i in range(0,20):
- for j in range(0,1):
- aux.append(arr[i][j])
- aux = list(map(int, aux))
- for i in range(0,20):
- for j in range(0,1):
- arr[i][j] = aux[i]
- aux = arr.copy()
- aux.sort()
- for i in range(0,20):
- for j in range(0,10):
- if(aux[i][1] == arr[j][1]):
- aux[i][1] = '-'
- for i in range(0,20):
- print(aux[i], end=' ')
- arr = [['0','ab'],['6','cd'],['0','ef'],['6','gh'],['4','ij'],['0','ab'],['6','cd'],['0','ef'],['6','gh'],['0','ij'],['4','that'],['3','be'],['0','to'],['1','be'],['5','question'],['1','or'],['2','not'],['4','is'],['2','to'],['4','the']]
- countSort(arr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement