Choose X such that ( A xor X ) + ( B xor X ) is minimized | finding X ; finding Sum ; Driver Code
function findX ( A , B ) { return A & B ; } function findSum ( A , B ) { return A ^ B ; } let A = 2 , B = 3 ; document . write ( " " + findX ( A , B ) + " " + findSum ( A , B ) ) ;