The electronic configuration of elements X and Y are X = 2, 8, 6; Y…