Solution (source code)

= Solution

Every boundary point of $D$ satisfies the <exterior sphere condition>. For a point on the inner spherical boundary, use a smaller ball inside the removed ball and tangent at that point; for a point on the cube, use a ball in a supporting exterior half-space. If the exterior ball has centre $y$ and radius $r$, a local positive harmonic barrier is
$$
w(x)=r^{2-n}-|x-y|^{2-n}
$$
for $n\geq3$, while in two dimensions use $w(x)=\log(|x-y|/r)$. Adding a sufficiently large positive multiple of a global superharmonic function extends the local barrier across the bounded domain. Hence every boundary point is regular by part (v), and the <Perron method for the Dirichlet problem> produces a harmonic function attaining the prescribed continuous boundary data. The <maximum principle for harmonic functions> gives uniqueness.