I need to make a function using just ~ and |, such that function f(6, 5) will return 4 as the answer.
~
|
f(6, 5)
4
By De Morgan's law, ~(a | b) equals ~a & ~b. By the same law, a & b equals ~(~a | ~b).
~(a | b)
~a & ~b
a & b
~(~a | ~b)