Sticker Mule Interview Question

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