This solution doesn't work for this problem. Passing the last for loop in your code doesn't guarantee it to be true: being able to form subsets whose sum is sub, 2 * sub... k * sub doesn't mean that they can be achieved at the same time.

For example, [2, 2, 2, 2, 3, 4, 5] and 4 as input, we can see there are subsets whose sum is 5, 10, 15 or 20. In your solution it would return true. Yet by simple observation we can see that there's no way we can split the array into 4 subsets whose sum is 5. (s1 = [5], s2 = [2, 3], we have 2, 2, 2, 4 left, there's no way we can make it work).