GumRoad interview question

Technical question - create an algorithm