Question #299622

you have been an integer array A of size N.you need to pfint the number with the value closest to zero.if there are multiple elements print the number with greater value.





Expert's answer

a = [-5, 9, -2, 6, 4]
min = min(a, key=lambda x: abs(x))
print(min)
LATEST TUTORIALS
APPROVED BY CLIENTS