Walmart interview question

Q: Walking through the code and introduce the method