Add solution to problem

Done! Added the output.txt file as well.