Butternut Box Interview Question

Solve month 1 to 3 retention problem