Google Interview Question

complete djistraka algorithm in 3 different ways