79476864

Date: 2025-02-28 23:10:52
Score: 1.5
Natty:
Report link

why so hard?

just index acces, condition, and recursions

def ordena(vector):

if len(vector)==1:
    return vector

if(vector[0]>vector[1]):
    vector[1], vector[0] = vector[0], vector[1]
    
vector = vector[0:1] + ordena(vector[1:])

return ordena(vector[:-1]) + vector[-1:]

v = [3,2,5,1,10,8,4] print (v) print(ordena(v))

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): why
  • Low reputation (1):
Posted by: chorcharg