Goal: Create an algorithm to…