1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-09-18 21:56:57 +02:00
CodeWars/6kyu/your_order_please/solution.py

13 lines
301 B
Python
Raw Permalink Normal View History

def order(sentence):
arr = sentence.split(' ')
result = ''
count = 1
for i in range(len(arr)):
for j in range(len(arr)):
if str(count) in arr[j]:
result += arr[j] + ' '
del arr[j]
count += 1
break
return result.strip()