find Decoded Ways in dynamic programming