I want to write an algorithm in a latex. There are various ways to write, but I want to write in the way given below. I have tried but I am not able to do anything similar to the given in the image.
see my code:
\documentclass{article}\usepackage[utf8]{inputenc} \begin{document}Algorithm \\Input : Output : \\1. $T \leftarrow $ an set of size $S$ \\2. \textbf{if} $x = 0$\\3. \hspace{1cm} \textbf{return}\end{document}
Question : Some of the problems, I am facing are the color of the background, line numbering, spacing etc