One more thought about the below.
I did fail that class, but eventually I learned to pass math classes by great effort. Essentially, because I have a very good to great memory, I learned to memorize a huge number of problems so I could kind-of almost see some relation to a problem and a vague guess to similarity was often enough to allow me to recall a problem (of my catalog of hundreds to thousands memorized) so that I could work out the one on the test exactly the same as the one I’d memorized step by step.
Needless to say, this required just herculean effort and means I didn’t understand anything at all.
Essentially, I was (without knowing it) applying AI techniques in a human mind to math problems — that is, I was “solving” them without understanding anything about them. Not the numbers, symbols, what should happen next or why. I had no idea.
All I know was I found a problem in my rote brain catalog and made the same transformations for no known reason.
I became a robot to do robotic things. I never understood a single thing I did or worked out in any math class — not once, ever.