O51
Partition Equal Subset Sum
Problem Statement & Objective
Given an integer array nums, return True if you can partition the array into two subsets such that the sum of the elements in both subsets is equal.
Function Signature (Python)
partition_equal_subset_sum(nums: list[int]) -> boolInput & Output Contract
Output Rule:True veya False.
System Constraints
1 <= sayilar.length <= 200
1 <= sayilar[i] <= 100Example Execution Walkthrough
sayilar = [1, 5, 11, 5] -> toplam 22 -> {11} ve {1, 5, 5} toplamları 11 -> True
sayilar = [1, 2, 3, 5] -> toplam 11 (tek sayı) -> bölünemez -> FalseExample Test Scenarios (3)
Example 1: Eşit Bölünür
Input:
[[1,5,11,5]]Expected Output:
trueExample 2: Tek Toplam
Input:
[[1,2,3,5]]Expected Output:
falseExample 3: Çift Toplam Ama Bölünemez
Input:
[[1,2,5]]Expected Output:
false