0 like 0 dislike
ago in Examples, Exercises and Projects by (7k points)

Input:
8
2 4 7 9 3 1 6 8


Output:
1 2 3 4 9 8 7 6

1 Answer

0 like 0 dislike
ago by (7k points)
 
Best answer

a=int(input())

b=input()

b=b.split(" ")

n_list=[]

           b.sort()

for i in range(a//2):

     n_list.append(int(b[i]))

for i in range(-1,(-a//2)-1,-1):

    n_list.append(int(b[i]))

print(n_list)

Register fast for winter training program at Goeduhub Technologies. We are providing winter training in AI-ML, IoT, Python, Hadoop and PLC-SCADA.

[[ CALL - 07976731765 ]]

...