Easy python solution
\nclass Solution:\n    def maxValueOfCoins(self, piles: List[List[int]], k: int) -> int:\n        presum = [list(accumulate(p, initial=0)) for p in piles]\n    
```\nclass Solution:\n    def maxValueOfCoins(self, piles: List[List[int]], k: int) -> int:\n        presum = [list(accumulate(p, initial=0)) for p in piles]\n        n = len(piles)\n        dp = [[0] * (k + 1) for _ in range(n + 1)]\n        for i, s in enumerate(presum, 1):\n            for j in range(k + 1):\n                for idx, v in enumerate(s):\n                    if j >= idx:\n                        dp[i][j] = max(dp[i][j], dp[i - 1][j - idx] + v)\n        return dp[-1][-1]\n        \n```
['Array', 'Dynamic Programming', 'Python3']