Solution

I used the solution. It’s a lot better than my approach. I’m just doing
this to move on. I’ll come back to this problem.