0
Smallest product of three numbers
Hello I have recently attempted one test In that test. The question is The program must accept N integers as the input .The program must print the smallest value obtained by multiplying three integers among N integers as the output. -3<=N<=1000 -1000<=Each integer<=1000 Testcases are: 5 -5 3 12 5 7 Output -420 #My code is N=int(input()) arr=list(map(int,input().split())) arr.sort() if(arr[0]<0): print(arr[0]*arr[-2]*arr[-1] else: print(arr[0]*arr[1]*arr[2]) For this code only 6 testcases are passed out of 8 test cases. could you please help me what could be the other test cases.
2 Antworten
+ 6
Voleti Varshith
Check for this condition [-6,-7,-3,13]
0
Thank you Ajith