Added P2

Added a solution to problem P2.