Let $X$ be a CW-complex, and $A$ a contractible subcomplex. Prove that the quotient map $X \rightarrow X/A $ is a homotopy equivalence.
I got a hint to use the homology version of Whitehead theorem to prove this question. but I have 2 versions in AT, they are given below:
But I do not know which to use and how to use, could anyone help me in this please?


Hint : let $x\in A$ be a point such that there is a homotopy between $id_A$ and the constant map at $x$. You can extend the homotopy between $i:A\to X$ (the inclusion) and $x: A\to X$ to $X$ to get a map $X\to X$ that is constant on $A$, and which is homotopic to $id_X$.