1 testcase not passing

You have tried to create an array of large size during runtime. See maximum value of n is 10^5 and k is 5000. In your code you have tried to create dp[n+1][k+1], for maximum value of n and k it become dp[100001][5001] which can’t be possible. We don’t have that much memory allocated for such question.
Refer this https://www.geeksforgeeks.org/subset-sum-problem-osum-space/