Closest Subsequence Sum - Read Statement

Given an integer array nums and an integer goal, choose a subsequence such that the sum is closest to goal. Return the minimum absolute difference.

Constraints: nums.length up to 4040. Brute force 2402^{40} is too slow. It requires meet-in-the-middle.