Well mesons are one normal and one antiquark, and with Pions and Kaons (+ versions) the normal particle is the up quark in both cases. So that's a help, and then the -ones are just the reverse. If you only need to know those two then just remember that pions are up-antidown and kaons are up-antistrange. Frankly, because the spelling of Kaon is strange.
I can't remember the structure of the 0 versions at the moment, but do you need to remember those is your exam anyway?