Walmart interview question

Nothing difficult. Just basic algorithms.