Not an expert, but med schools generally care more about time in a subject than the actual courses taken.
So as long as you've completed x number of credits in physics up to at least level y, you should be fine.
The policy may vary from school to school though, so you should check websites/ask someone in admissions for an official answer.