Added solution to problem 6
Merge branch 'problem6'