Sticker Mule interview question

Very basic hackerank question, someone who has recently started programming can also solve.