You know it’s an easy algorithm to program when you’re done writing it, before the teacher is done explaining it…

80071e77cce4ec17e171c616d83ab8fd001