solve dp 01