Leetcode:

public boolean canPartition(int[] nums) {
    int sum = 0;
    for(int num : nums) {
        sum += num;
    }
    if(sum % 2 != 0)
        return false;

    int half = sum / 2;
    boolean[] dp = new boolean[half + 1];
    dp[0] = true;
    for(int num: nums) {
        for(int i = half; i >= num; i--) {
            if(dp[i - num] == true)
                dp[i] = true;
        }
    }
    return dp[half];
}

Longest common subsequence video, https://www.youtube.com/watch?v=ASoaQq66foQ


darren987469