Create Problem Alg2

the result isn't same as given one;
also need to free the pointer