mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
42 lines
1.1 KiB
HTML
42 lines
1.1 KiB
HTML
<p>给你一个整数数组 <code>digits</code>,你可以通过按任意顺序连接其中某些数字来形成 <strong>3</strong> 的倍数,请你返回所能得到的最大的 3 的倍数。</p>
|
||
|
||
<p>由于答案可能不在整数数据类型范围内,请以字符串形式返回答案。</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>
|
||
<li>返回的结果不应包含不必要的前导零。</li>
|
||
</ul>
|