Partition equal subset sum

Write codeMedium20 min

Your task

Given an array of positive integers, determine whether it can be split into two subsets with equal sum. Return a boolean. The array has at least one element.

Examples

can_partition(nums: list[int]) -> bool
Example 1
Inputcan_partition([1, 5, 11, 5])
OutputTrue