Find the missing numbers between smallest and largest element in the array.
Interview Answers
Anonymous
30 Mar 2019
reverse the value stored in int type.
Anonymous
1 May 2020
list_a = [1, 23, 12, 98, 30, 2, 50]
for i in range(int(len(list_a))):
for j in range(i):
if list_a[j] > list_a[j+1]:
x = list_a[j]
list_a[j] = list_a[j+1]
list_a[j+1] = x
print (list_a[0],list_a[int(len(list_a)-1)])
for i in range(list_a[0],list_a[int(len(list_a)-1)]):
print (i)