In short, if you can find a solution for the electric potential that satisfies your boundary conditions for the electric potential, and the charge density within the considered region, you've found the unique solution. This is due to the uniqueness theorem.
That fact allows you to cleverly pick an arrangement of charges outside your considered region that satisfies your electric potential boundary conditions (usually by taking advantage of/introducing symmetries) and know that you've found the only solution that exists for your configuration.