If they both have the same potential, they both have the same charge, since the charge resides on the surface of the items, and of course the spheres are metal, and hence the potential is constant within.
We know that C= 4ε₀πr
where symbols have their usual meanings. We observe that capacitance depends only on the radius of the charged sphere independent of its mass.
Therefore, both hollow and solid sphere will have same capacitance means they will hold the same charge.