It must be noted that our compound contains only two components, N and O. From the given masses, the total mass of the compound should be 300 g.
Then, we divide the masses of each component by the total mass and multiply the quotients by 100% to get the % compositions
N = (222.6 g / 300 g) x 100% = 74.2%
O = (77.4 g / 300 g) x 100% = 25.8%