Answer:
See detailed explanation.
Step-by-step explanation:
Hello.
In this case, since the electron configuration of potassium whose atomic number is 19 turns out:

We can see that the last level is 4 which has one electron, meaning that potassium has one valence electron. Moreover, since bromine's atomic number is 35, its electron configuration is:

We can see that the last level is also 4 and it has 2+5 = 7 valence electrons. In such a way, we infer that the valence electrons are computed by the electrons at the outer or last energy level of an element.
Regards.