Pregunta de entrevista de Wayfair

Simple case regarding self-service, routine math