• + 0 comments

    def solve (arr): # simple but slow - combining all mx = arr [0] #max (arr) res = 0 for j in range (1, len (arr)): mx = arr [j] if arr [j] > mx else mx for i in range (j): if (arr [i] * arr [j] <= mx): res += 1 return res