Walmart Interview Question

whiteboard python programming solution for given 3 problems.