Solution.
First, we will show that we can replace K with a connected compact set. Let δ=21d(K,Ωc)>0 and for each z∈K, notice that B(z,δ)⊆Ω. By compactness, there exist finitely many balls which cover K, and this cover has finitely many connected components (since there are only finitely many balls). Thus, replacing K with the closure of these balls, we may assume without loss of generality that K has finitely many connected components. Since Ω is (path) connected, we can connect these components with finitely many curves. Replacing K with K union these curves, we may thus assume without loss of generality that K is a connected compact set.
For each z∈K, let Rz>0 be such that B(z,2Rz)⊆Ω. By compactness, there exist z1,…,zN such that {B(zn,Rn)}n cover K. Fix a z0∈K. For any z∈K, path connectedness of K gives γ such that γ(0)=z0 and γ(1)=z, and so we get a sequence {B(znk,Rnk)}1≤k≤M such that z0∈B(zn0,Rn0), z∈B(znM,RnM), and B(znk,Rnk)∩B(znk+1,Rnk+1)=∅. We may remove duplicates without breaking this property, so we have a strict subset of A.
Notice that if w∈B(znk,Rnk)∩B(znk+1,Rnk+1), then Harnack's inequality gives
31u(znk)=2Rnk+Rnk2Rnk−Rnku(znk)≤u(w),u(w)≤2Rnk−Rnk2Rnk+Rnku(znk)=3u(znk+1),
so u(znk)≤9u(znk+1). Hence, by induction, we see
u(z)≤3⋅9Mu(z0)≤3⋅9Nu(z0).
Let CK=3⋅9N. Since z was arbitrary, we see
z∈Ksupu(z)≤CKu(z0).
Similarly, z0 was arbitrary, so
z∈Ksupu(z)≤CKz∈Kinfu(z).