When you’re moving and working out or just working up a sweat, it’s not just water that you’re losing. Lost electrolytes are also a contributing factor to leg and muscle cramps. Most often, a loss of sodium, magnesium, calcium, or potassium is the cause of leg cramps. If you’re drinking enough water, try eating a banana or some sweet potatoes. Spinach and nuts are also good options for restoring the much-needed minerals.