the p1_7

Time M*N, space (M + N), still try to find some better solution.