Add solution to problem #8

Solved problem #8 using kadene's algo