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.
1
Expert's answer
2022-02-18T12:50:33-0500
a = [-5, 9, -2, 6, 4]
min = min(a, key=lambda x: abs(x))
print(min)
Comments
Leave a comment