Skip to content

Commit f6108ca

Browse files
committed
Create README - LeetHub
1 parent a68324e commit f6108ca

File tree

1 file changed

+33
-0
lines changed
  • 1262-greatest-sum-divisible-by-three

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h2><a href="https://leetcode.com/problems/greatest-sum-divisible-by-three">1388. Greatest Sum Divisible by Three</a></h2><h3>Medium</h3><hr><p>Given an integer array <code>nums</code>, return <em>the <strong>maximum possible sum </strong>of elements of the array such that it is divisible by three</em>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong class="example">Example 1:</strong></p>
5+
6+
<pre>
7+
<strong>Input:</strong> nums = [3,6,5,1,8]
8+
<strong>Output:</strong> 18
9+
<strong>Explanation:</strong> Pick numbers 3, 6, 1 and 8 their sum is 18 (maximum sum divisible by 3).</pre>
10+
11+
<p><strong class="example">Example 2:</strong></p>
12+
13+
<pre>
14+
<strong>Input:</strong> nums = [4]
15+
<strong>Output:</strong> 0
16+
<strong>Explanation:</strong> Since 4 is not divisible by 3, do not pick any number.
17+
</pre>
18+
19+
<p><strong class="example">Example 3:</strong></p>
20+
21+
<pre>
22+
<strong>Input:</strong> nums = [1,2,3,4,4]
23+
<strong>Output:</strong> 12
24+
<strong>Explanation:</strong> Pick numbers 1, 3, 4 and 4 their sum is 12 (maximum sum divisible by 3).
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li><code>1 &lt;= nums.length &lt;= 4 * 10<sup>4</sup></code></li>
32+
<li><code>1 &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
33+
</ul>

0 commit comments

Comments
 (0)