Lithium:
We also know that its 1s orbital is full, because to get to lithium in the periodic table, we have to pass 1s. There are 2 electrons in an s orbital; this means that it has 2 electrons in its 1s orbital: 1s2.
Putting it all together, we get 1s22s1
Oxygen:
From its position in the periodic table, we know that it has 4 valence electrons in the 2p orbital series (because it's in the second period): 2p4.
We also know that:
∙ Its 1s orbital is full. There are 2 electrons in an s orbital; this means that it has 2 electrons in its 1s orbital: 1s2.
∙ Its 2s orbital is full. There are 2 electrons in an s orbital; this means that it has 2 electrons in its 2s orbital: 2s2.
Putting it all together, we get 1s22s22p4.
Nitrogen:
Nitrogen is directly to the left of oxygen in the periodic table. This tells us that it has one less electron than oxygen therefore, its electron configuration is the exact same as oxygen's, except with one less electron in the valence energy level.
Oxygen's electron configuration is 1s22s22p4.
After taking one electron from that, it becomes 1s22s22p3—nitrogen.
Potassium:
From its position in the periodic table, we know that it has 1 valence electron in the 4s orbital series (because it's in the s block of the fourth period): 4s1.
We also know that:
∙ Its 1s orbital is full. There are 2 electrons in an s orbital; this means that it has 2 electrons in its 1s orbital: 1s2.
∙ Its 2s orbital is full. There are 2 electrons in an s orbital; this means that it has 2 electrons in its 2s orbital: 2s2.
∙ Its 2p orbital is full. There are 6 electrons in an s orbital; this means that it has 6 electrons in its 2p orbital: 2p6.
∙ Its 3s orbital is full. There are 2 electrons in an s orbital; this means that it has 2 electrons in its 3s orbital: 3s2.
∙ Its 3p orbital is full. There are 6 electrons in an s orbital; this means that it has 6 electrons in its 3p orbital: 3p6.
Putting it all together, we get 1s22s22p63s23p64s1.