Verisk Interview Question

They asked me to program a simple algorithm.