If $H,K \leq G$ a finite group, then $$\left\lvert HK \right\rvert = \frac{\left\lvert H \right\rvert \cdot \left\lvert K \right\rvert}{\left\lvert H\cap K \right\rvert}.$$
The first part of the problem asked us to show this when $\left\lvert H\cap K \right\rvert=1$. This was doable and I used a counting argument saying how if we had some $h_ik_j=h_lk_m$ then $h_i=h_l$ and $k_j=k_m$. Then counting the size of the set $HK$ was straightforward.
My attemps for this problem have been saying something like $$\frac{\left\lvert H \right\rvert \cdot \left\lvert K \right\rvert}{\left\lvert H\cap K \right\rvert}= \frac{\left\lvert H / (H \cap K) \right\rvert \cdot \left\lvert H \cap K \right\rvert^2 \cdot \left\lvert K / (H \cap K ) \right\rvert}{\left\lvert H \cap K \right\rvert}=\left\lvert H \cap K \right\rvert \cdot \left\lvert H / (H \cap K) \right\rvert \cdot \left\lvert K / (H \cap K) \right\rvert$$ $$= \left\lvert H \right\rvert \cdot \left\lvert K / (H \cap K) \right\rvert.$$
Any ideas for ways I could solve this?