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

Input : arr[]={1, 32, 5, 6, 9, 3} and k=2 

Output : arr[]={56, 93, 132}


 

1 Answer

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

a=[1,21,3,4,5,6]

a_n=[]

b=int(input())

c=len(a)//b

for i in range(b):

    s=''

    for j in range(c):

        print(a[j],end='')

        s=s+str(a[j])

    a_n.append(int(s))

    print("")

    del(a[0:j+1])

a_n.sort()

print(a_n)

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 ]]

...