recursion -> map -> DP