As a young adult, I had the same problem once or twice per week. There are many potential causes, but I was lucky to find the cause of mine on the first try (after suffering with them for a few years). Now I take a daily potassium supplement. (One 550mg tablet of potassium gluconate daily.)
I haven't had a leg cramp for decades.