Dynamic Programming: Knapsack - Last Stone Weight II
Given the function below, what is the output when stones = [2, 7, 4]?
```python
def lastStoneWeightII(stones):
total = sum(stones)
half = total // 2
dp = [False] * (half + 1)
dp[0] = True
for stone in stones:
for j in range(half, stone - 1, -1):
dp[j] = dp[j] or dp[j - stone]
for j in range(half, -1, -1):
if dp[j]:
return total - 2 * j
```
