You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Given an integer array <code>nums</code>, return <code>true</code> <em>if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or </em><code>false</code><em> otherwise</em>.</p>
2
+
3
+
<p> </p>
4
+
<p><strongclass="example">Example 1:</strong></p>
5
+
6
+
<pre>
7
+
<strong>Input:</strong> nums = [1,5,11,5]
8
+
<strong>Output:</strong> true
9
+
<strong>Explanation:</strong> The array can be partitioned as [1, 5, 5] and [11].
10
+
</pre>
11
+
12
+
<p><strongclass="example">Example 2:</strong></p>
13
+
14
+
<pre>
15
+
<strong>Input:</strong> nums = [1,2,3,5]
16
+
<strong>Output:</strong> false
17
+
<strong>Explanation:</strong> The array cannot be partitioned into equal sum subsets.
0 commit comments