Add solution for problem B2