Add solution and tests for the third task