potassium is one of the "macro" minerals along with calcium, magnesium, phosphorous, sodium, and Iron.
If your symptoms are concomitant with potassium deficiency ((hypokalemia)then your pre-fast diet will have been inadequate, which means you are essentially malnourished.
The symptoms of Potassium deficiency include: weakness, lack of energy, muscle cramps, stomach disturbances, an irregular heartbeat, and an abnormal EKG (electrocardiogram).
Potassium deficiency will also increase acid levels in the body, lowering the natural pH, which will have far reaching effects. Lack of potassium can also aggravate problems caused by lack of protein. Potassium deficiency can cause problems with the formation of connective tissue, and can make normally strong body tissue vulnerable to all kinds of problems.
A deficiency of potassium (hypokalemia) can also occur in people with chronic disease or as a result of the aging process. The most common problems associated with reduced potassium levels are hypertension, congestive heart failure, cardiac arrhythmias, depression, and fatigue.
I think you have to take into account the overall symptom-complex that you are experiencing and not just "leg pains" as a starting point.
It may also be wise to have a a full body mineral analysis before undertaking another fast, to establish if this is the true cause. If so, then you will need to improve your pre-fast diet for a month or two before undertaking another fast.
Leg pains in isolation, tell me that this is NOT potassium deficiency.
I also find it hard to believe that you are potassium deficient, as this mineral is abundant in many foodstuffs, unless you have a mal-absorption problem.