\documentclass{article}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{float}
\usepackage{lipsum}
\newfloat{algorithm}{t}{lop}
\begin{document}
This text comes before the algorithm. \lipsum[2-4]
\begin{algorithm}[t]
\caption{An algorithm with caption}\label{alg:cap}
\begin{algorithmic}
\Require $n \geq 0$
\Ensure $y = x^n$
\State $y \gets 1$
\State $X \gets x$
\State $N \gets n$
\While{$N \neq 0$}
\If{$N$ is even}
\State $X \gets X \times X$
\State $N \gets \frac{N}{2}$ \Comment{This is a comment}
\ElsIf{$N$ is odd}
\State $y \gets y \times X$
\State $N \gets N - 1$
\EndIf
\EndWhile
\end{algorithmic}
\end{algorithm}
This comes after. \lipsum[1-2]
\end{document}
I want to wrap text around an algorithm. I've tried the solution here but that didn't seem to work. For some reason the text is still not wrapping around the algorithm. 
algorithmis a float. It's meant to float around, and you purposefully suggest the[t]op. If you don't want things to float, then you can review this: How to influence the position of float environments like figure and table in LaTeX? – Werner Sep 15 '21 at 21:56