> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0416_partition_equal_subset_sum/slt.md).

# Solution 1 dp

if sum is odd, then return false

state definition:

dp\[i]\[j] means select numbers from index of \[0, i], and very numbers can only bu used once, let sum of these numbers to be j.

if j < nums\[i], 则要和为 j 的情况下，不能选 nums\[i]，则 dp\[i]\[j] = dp\[i-1]\[j]

if j >= nums\[j], 则可以选也可以不选

dp\[i]\[j] = dp\[i-1]\[j] || dp\[i-1]\[j-nums\[i]]
