mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
43 lines
1.1 KiB
HTML
43 lines
1.1 KiB
HTML
<p>给你一个整数数组 <code>digits</code>,你可以通过按 <strong>任意顺序</strong> 连接其中某些数字来形成 <strong>3</strong> 的倍数,请你返回所能得到的最大的 3 的倍数。</p>
|
||
|
||
<p>由于答案可能不在整数数据类型范围内,请以字符串形式返回答案。如果无法得到答案,请返回一个空字符串。返回的结果不应包含不必要的前导零。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>digits = [8,1,9]
|
||
<strong>输出:</strong>"981"
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>digits = [8,6,7,1,0]
|
||
<strong>输出:</strong>"8760"
|
||
</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>digits = [1]
|
||
<strong>输出:</strong>""
|
||
</pre>
|
||
|
||
<p><strong>示例 4:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>digits = [0,0,0,0,0,0]
|
||
<strong>输出:</strong>"0"
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= digits.length <= 10^4</code></li>
|
||
<li><code>0 <= digits[i] <= 9</code></li>
|
||
</ul>
|