Walmart interview question

whiteboard python programming solution for given 3 problems.