aboutsummaryrefslogtreecommitdiff
path: root/challenge-163/eric-cheung/python/ch-1.py
blob: 1f24f83f6d67462ac7d618440eb3e97bdce09d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
## arrNum = [1, 2, 3] ## Example 1
arrNum = [2, 3, 4] ## Example 2
nSum = 0

for nRow in range (0, len(arrNum) - 1):
    for nCol in range (nRow + 1, len(arrNum)):
        ## print (str(arrNum[nRow]) + " & " + str(arrNum[nCol]) + " = " + str(arrNum[nRow] & arrNum[nCol]))
        nSum = nSum + (arrNum[nRow] & arrNum[nCol])

print (nSum)