State Farm Interview Question

A problem that i had to solve