There is a trick that I follow the answer for algorithm2e split over several pages by outmind
\documentclass{report}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\begin{document}
\begin{algorithm}
\caption{abc dcc}
\LinesNumbered
% This is to hide end and get the last vertical line straight
\SetKwBlock{Begin}{Begin}{}
\SetAlgoLined
\SetKwProg{Loop}{LOOP}{}{}
\Begin{
$\mathcal{E} \leftarrow \emptyset$\;
\SetAlgoVlined \Loop {$ab \gets cd$}{
$abcd$\\
$abdc $ }
}
\end{algorithm}
\SetNlSty{texttt}{(}{)}
\begin{algorithm}
\LinesNumbered
\setcounter{AlgoLine}{12}
% This is to restore vline mode if you did not take the package as \usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\SetAlgoVlined
%This is to hide Begin keyword
\SetKwBlock{Begin}{}{end}
\SetKwProg{Loop}{LOOP}{}{}
\Begin{
$\mathcal{E} \leftarrow \emptyset$\;
$\mathcal{E} \leftarrow \emptyset$\;
\SetAlgoVlined \Loop {$ab \gets cd$}{
$abcd$\\
$abdc $ }
$\mathcal{E} \leftarrow \emptyset$\;
$\mathcal{E} \leftarrow \emptyset$\;
$\mathcal{E} \leftarrow \emptyset$\;
}
\end{algorithm}
\begin{algorithm}
\caption{fbf jfjf}
\LinesNumbered
% This is to restore vline mode if you did not take the package as \usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\SetAlgoVlined
%This is to hide Begin keyword
\SetKwProg{Loop}{LOOP}{}{}
\SetKwBlock{Begin}{loop3}{end}
\Begin{
$\mathcal{E} \leftarrow \emptyset$\;
$\mathcal{E} \leftarrow \emptyset$\;
\SetAlgoVlined \Loop {$ab \gets cd$}{
$abcd$\\
$abdc $ }
$\mathcal{E} \leftarrow \emptyset$\;
$\mathcal{E} \leftarrow \emptyset$\;
$\mathcal{E} \leftarrow \emptyset$\;
}
\end{algorithm}
\end{document}

For line numbering you can use \usepackage[ruled,vlined]{algorithm2e} instead of \usepackage[linesnumbered,ruled,vlined]{algorithm2e} and number the lines by using \nl. Or you can use \LinesNotNumbered{ before begin{algorithm}
To remove the rule line : there are three ways: first, using
\setlength{\algoheightrule}{0.8pt} % thickness of the rules above and below
\setlength{\algotitleheightrule}{0pt} % thicknes of the rule below the title
2nd: Remove the rule below the algorithm title - using Algorithm2e
3rd: good way, top, bottom, middle line colored by using Colored horizontal lines in algorithm2e by Werner