"given the updated input and output pairs below, generate code that would solve the problem."