added solution for the first problem