Safeway Interview Question

How I would handle L&P