Adding solution to D problem