So for my final assignment in my Computer Systems class, we need to optimize these for loops to be faster …