'''
Array {data} contains arrays of elements of database query times [speed,isSuccess] 
isSuccess values are defined as follows:
1 = true,
-1 = false,
0 = no data

Calculate the average speed of successful queries
'''

def solution(data):
    pass
'''
Test Cases
'''
print(solution([[3, 1],
                [6, 1],
                [4, 1],
                [5, 1]]
              )
     ) #output 4.5


print(solution([[4,1], 
                 [4,-1], 
                 [0,0], 
                 [6,1]]
              )
     ) #output 5.0


print(solution([[4,-1], 
                 [0,0], 
                 [5,-1]]
              )
     ) #output 0

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: