Learn practical skills, build real-world projects, and advance your career
Updated 2 years ago
!pip install jovian --upgrade --quiet
1.maximum pairwise product
Problem
a list of +ve integers will be given. list can have any number between 0 & . we need to find the maximum pairwise product from the list...product of same inputs ..i.e square not allowed...list not sorted
Inputs
- l = [2,3]
Output
- output = 6
sample inputs and outputs
- empty list
- a small list
- all elements in list same
- list has only one element
- a long list
test0 = {
'input' :{
'l' : []
},
'output': 0
}
test1 = {
'input' :{
'l' : [1,2,3,4,5]
},
'output': 20
}
test2 = {
'input' :{
'l' : [3,3,3,3,3]
},
'output': 0
}
test3 = {
'input' :{
'l' : [3]
},
'output': 0
}
test4 = {
'input' :{
'l' : list(range(1,100000, 3))
},
'output': 9999100018
}
tests = [ test0, test1, test2, test3, test4]