1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-09-16 20:56:57 +02:00
CodeWars/6kyu/your_order_please/solution.py
Matej Focko fc899b0b02
chore: initial commit
Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-12-28 16:19:58 +01:00

12 lines
301 B
Python

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()