APG solution added.

1) APG solution added.
2) Greedy solution has a small problem.