- it is unknown, how you try to change answer in given link
- If I understand correctly your problem, you only need to remove some arrows:
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
quotes,
tikzmark}
\tikzset{
is/.style = {inner ysep=2pt, minimum height=2ex},
num/.style = {circle, draw, fill=white,font=\tiny,
inner sep=0.5pt, outer sep=1pt},
every edge/.style = {draw, -Straight Barb},
every edge quotes/.append style = {num, anchor=center}
}
\begin{document}
[
\tikzmarknode[is]{A}{a}\cdot(\tikzmarknode[is]{B}{b} + \tikzmarknode[is]{C}{c})
= \tikzmarknode{AB}{ab}+\tikzmarknode{AC}{ac}
]
\begin{tikzpicture}[remember picture, overlay, cyan]
\draw (A.north) edge[out=60,in=120,looseness=2,"1"] (B.north)
(A.north) edge[out=75,in=115,looseness=2,"2"] (C.north) ;
\foreach \n [count=\i] in {AB,AC}
\node[num,above=10pt] at (\n.south) {\i};
\end{tikzpicture}
\end{document}
Note: cdot is inserted that between a and b is more space for drawing arrow.
After three compilation above MWE produces:

Is this what you after?