Loop to iterate over all possible pairs from L to R
for j in range ( l - 1 , r , 1 ) : NEW_LINE INDENT for k in range ( j + 1 , r , 1 ) : NEW_LINE INDENT sum += ( a [ j ] * a [ k ] ) ; NEW_LINE DEDENT DEDENT