From the truth table we not that `Y = A + B`
i.e., it is for `OR` gate (or)
`A + X = A + B = A + B.(A + overline A) (because A + overline A = 1)`
then, `A + X = A + B.A + B. overline A`
`= A.(1 + B) + overline A.B = A + overline A.B`
So `X = A + overline A.B`, which is `AND` gate with inputes as `overline A` and `B`.