Completed the DP solution for subset sum problem