Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 858813d

Browse files
committed
Added README.md file for Partition Array Into Three Parts With Equal Sum
1 parent 2852e59 commit 858813d

File tree

1 file changed

+35
-0
lines changed
  • 1062-partition-array-into-three-parts-with-equal-sum

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<h2><a href="https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum">Partition Array Into Three Parts With Equal Sum</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given an array of integers <code>arr</code>, return <code>true</code> if we can partition the array into three <strong>non-empty</strong> parts with equal sums.</p>
2+
3+
<p>Formally, we can partition the array if we can find indexes <code>i + 1 &lt; j</code> with <code>(arr[0] + arr[1] + ... + arr[i] == arr[i + 1] + arr[i + 2] + ... + arr[j - 1] == arr[j] + arr[j + 1] + ... + arr[arr.length - 1])</code></p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> arr = [0,2,1,-6,6,-7,9,1,2,0,1]
10+
<strong>Output:</strong> true
11+
<strong>Explanation: </strong>0 + 2 +たす 1 = -ひく6 +たす 6 -ひく 7 +たす 9 +たす 1 = 2 +たす 0 +たす 1
12+
</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> arr = [0,2,1,-6,6,7,9,-1,2,0,1]
18+
<strong>Output:</strong> false
19+
</pre>
20+
21+
<p><strong class="example">Example 3:</strong></p>
22+
23+
<pre>
24+
<strong>Input:</strong> arr = [3,3,6,5,-2,2,5,1,-9,4]
25+
<strong>Output:</strong> true
26+
<strong>Explanation: </strong>3 +たす 3 = 6 = 5 -ひく 2 +たす 2 +たす 5 +たす 1 -ひく 9 +たす 4
27+
</pre>
28+
29+
<p>&nbsp;</p>
30+
<p><strong>Constraints:</strong></p>
31+
32+
<ul>
33+
<li><code>3 &lt;= arr.length &lt;= 5 * 10<sup>4</sup></code></li>
34+
<li><code>-10<sup>4</sup> &lt;= arr[i] &lt;= 10<sup>4</sup></code></li>
35+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /