• + 0 comments

    simplicity at its finest in Go

    func andProduct(a int64, b int64) int64 {
        res := a
        for i := a+1;i <= b;i++ {
            res = res & i
        }
        
        return res
    }