Implemented decoding ways DP solution.