The correct option is B CN−, CO
The trick here is to calculate the number of electrons in each species. The traditional way is to use M.O.T and it is the most rigorous way.
O2 has 16 electrons and NO+ has 14 electrons.
CN− has 14 electrons and CO has 14 electrons.
N2 has 14 electrons and O2 has 17 electrons.
CO has 14 electrons and NO has 15 electrons.
Since we know only 1 option is correct, we can clearly go for the second one.