[Tex/LaTex] How to draw array with arrows

arrowstablestikz-pgf

I want to draw this:

enter image description here

Till now I am able to draw this much but struggling with red arrows

\documentclass{article} 
\usepackage{etoolbox}
\begin{document}
\begin{center}
\begin{tabular}{ |c|c|c|c|c|c|c|c| } 
\hline
 3 & 4 & 2 & 1 & 4 & 1 & 2 & 3  \\
\hline
\hline 
\end{tabular}
\end{center}
\end{document}

Best Answer

If you accept a pure TikZ solution:

\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{positioning,matrix, arrows.meta}

\begin{document}
\begin{tikzpicture}
\matrix (A) [matrix of nodes, nodes={draw, minimum size=8mm},
    column sep=-\pgflinewidth]{
    3 & 4 & 2 & 1 & 4 & 1 & 2 & 3\\};
\foreach \i [evaluate=\i as \ni using {int(\i)},
                evaluate=\i as \ntext using {int(\i-1)}] in {1,3,4,6} 
    \draw [{Stealth}-, red!70] (A-1-\ni.south west)--++(-90:5mm) node[below] {\ntext};
\end{tikzpicture}
\end{document}

enter image description here