FWIW, cramping (spontaneous myospasm) is a function of electrolyte (mineral) deficiency or imbalance often exacerbated by mineral loss from exertion, heat/humidity exposure, prescription hyertension medications ("blood pressure pills"), prescription diuretics ("water pills"), dietary diuretics (coffee, alcohol), and subclinical dehydration (not enough water intake).
While potassium is one of the mineral electrolytes, magnesium is also involved as are others, including sodium, manganese, chromium, selenium, etc. Often, branded supplements will contain their "title" content (B-complex or C), but also some electrolytes causing one to assume it is the "title" content providing the outcome. An example is the product "Emergen-C", a drink mix that contains a broad spectrum electrolyte effective for cramp control in many cases. It is not the Vitamin C that affects the cramping, but the electrolytes. Seek a broad spectrum electrolyte capsule and be aware that too much magnesium yields laxative effects.
Be aware that B-complex vitamins (not so much B-12) stimulate the energy metabolism and should be avoided late in the day lest they lead to a bad night's sleep and a grumpy tomorrow . . .