Maximum OR sum of sub | function to find maximum OR sum ; OR sum of all the elements in both arrays ; Driver Code
def MaximumSum ( a , b , n ) : NEW_LINE INDENT sum1 = 0 NEW_LINE sum2 = 0 NEW_LINE for i in range ( 0 , n ) : NEW_LINE INDENT sum1 |= a [ i ] NEW_LINE sum2 |= b [ i ] NEW_LINE DEDENT print ( sum1 + sum2 ) NEW_LINE DEDENT A = [ 1 , 2 , 4 , 3 , 2 ] NEW_LINE B = [ 2 , 3 , 3 , 12 , 1 ] NEW_LINE n = len ( A ) NEW_LINE MaximumSum ( A , B , n ) NEW_LINE