Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. def countSort(arr):
  2.  
  3. aux = []
  4.  
  5. for i in range(0,20):
  6. for j in range(0,1):
  7. aux.append(arr[i][j])
  8. aux = list(map(int, aux))
  9.  
  10.  
  11. for i in range(0,20):
  12. for j in range(0,1):
  13. arr[i][j] = aux[i]
  14.  
  15. aux = arr.copy()
  16.  
  17.  
  18. aux.sort()
  19.  
  20.  
  21. for i in range(0,20):
  22. for j in range(0,10):
  23. if(aux[i][1] == arr[j][1]):
  24. aux[i][1] = '-'
  25.  
  26.  
  27. for i in range(0,20):
  28. print(aux[i], end=' ')
  29.  
  30.  
  31.  
  32.  
  33. 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']]
  34.  
  35. countSort(arr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement