Show that $G$ is cyclic if $G$ has at most two proper subgroup
First of all it is not a duplicate I know there is an answer here: If $G$ has only 2 proper, non-trivial subgroups then $G$ is cyclic
However, I did not understand the answer. So I will write my attempt.
My Attempt:
$\underline{\text{Case 1 : } \vert G\vert=pq, \text{where p and q are primes}}$
$\vert H\vert$ divides $pq$ and $\vert K\vert$ divides $pq$ by Lagrange Theorem. By assumption these subgroups are unique. Thus G is cyclic. Since there is at most four subgroups with orders $1, p,q,pq$.
$\underline{\text{Case 2 : } \vert G\vert=p^2, \text{where p is prime}}$
Again Lagrange implies only three subgroups of order $1,p,p^2$. A contradiction! So, in $pq$ we can assume $p \neq q$
$\underline{\text{Case 3 : } \vert G\vert=n, \text{where n is composite}}$
Since $n$ is composite we can write $n=mk$, where $1<m,k<n$. Again by Lagrange Theorem we have:
$$\vert H \vert \text{ divides } m\cdot k \text{ and } \vert K\vert \text{ divides } m\cdot k$$
These are only subgroups. Hence this implies $m$ and $k$ must be prime. Otherwise, some subgroup of order $l$, where $l$ divides $m\cdot k$. But this means we have more then $2$ subgroups. This means $n=pq$ with $p \neq q$.
Are there any mistake?