The shells are filled with electrons in a particular order with K shell filled first followed by L and then M.
The order of filling up of shells is decided by energy of the orbitals with the shell of lower energy being filled first.
Shells are made up of subshells.
In M shell, one type of subshell has a higher energy than a subshell of N shell and is filled before the rest 10 electrons are filled in M shell.
Therefore, potassium has an electronic configuration 2,8,8,1.
The concept or subshells is taught at a higher grade and the answer has been simplified.