Skip to content

LeetCode 416. Partition Equal Subset Sum#51

Merged
huyfififi merged 6 commits intomainfrom
leetcode-416-partition-equal-subset-sum
Mar 8, 2026
Merged

LeetCode 416. Partition Equal Subset Sum#51
huyfififi merged 6 commits intomainfrom
leetcode-416-partition-equal-subset-sum

Conversation

@huyfififi
Copy link
Owner

@huyfififi huyfififi self-assigned this Mar 4, 2026
@huyfififi huyfififi marked this pull request as ready for review March 4, 2026 10:24
if i + num > half_sum:
continue

possible[i + num] = True
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i + num == half_sum の時に return True して、最後は return False しても良いと思いました。

std::vector<uint8_t> possible(half_sum + 1);
possible[0] = 1;

for (const auto& num : nums) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらのコメントをご参照ください。
hemispherium/LeetCode_Arai60#10 (comment)

@huyfififi huyfififi merged commit e7f5aca into main Mar 8, 2026
@huyfififi huyfififi deleted the leetcode-416-partition-equal-subset-sum branch March 8, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants