AND Product Time : O(log(min(a,b))) Space : O(1) 123456long andProduct(long a, long b) { if(!a or !b) return 0; long lga = log2(a), lgb = log2(b); if(lga == lgb) return (1ll<<lga) + andProduct(a ^ (1ll<<lga), b ^ (1ll<<lga)); return 0;}