I\'m trying to solve this problem for school. I wrote some code for it, however I am not sure if my code is correct because when I checked website (linked below) for the for