Learn practical skills, build real-world projects, and advance your career
!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 & 10510^5 . we need to find the maximum pairwise product from the list...product of same inputs ..i.e square not allowed...list not sorted

Inputs

  1. l = [2,3]

Output

  1. output = 6

sample inputs and outputs

  1. empty list
  2. a small list
  3. all elements in list same
  4. list has only one element
  5. 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]