(a) An atom of X must lose its two electrons to attain the nearest inert gas electron configuration.
(b) After losing two electrons, it will have 10 electrons with electronic configuration 2,8, which represents neon gas. So, neon gas is the nearest inert gas to X.