mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			980 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			980 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>闯关游戏需要破解一组密码,闯关组给出的有关密码的线索是:</p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li>一个拥有密码所有元素的非负整数数组 <code>password</code></li>
 | 
						||
	<li>密码是 <code>password</code> 中所有元素拼接后得到的最小的一个数</li>
 | 
						||
</ul>
 | 
						||
 | 
						||
<p>请编写一个程序返回这个密码。</p>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>示例 1:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入: </strong>password = [15, 8, 7]
 | 
						||
<strong>输出: </strong>"1578"</pre>
 | 
						||
 | 
						||
<p><strong>示例 2:</strong></p>
 | 
						||
 | 
						||
<pre>
 | 
						||
<strong>输入: </strong>password = [0, 3, 30, 34, 5, 9]
 | 
						||
<strong>输出: </strong>"03033459"</pre>
 | 
						||
 | 
						||
<p> </p>
 | 
						||
 | 
						||
<p><strong>提示:</strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li><code>0 < password.length <= 100</code></li>
 | 
						||
</ul>
 | 
						||
 | 
						||
<p><strong>说明: </strong></p>
 | 
						||
 | 
						||
<ul>
 | 
						||
	<li>输出结果可能非常大,所以你需要返回一个字符串而不是整数</li>
 | 
						||
	<li>拼接起来的数字可能会有前导 0,最后结果不需要去掉前导 0</li>
 | 
						||
</ul>
 | 
						||
 | 
						||
<p> </p>
 |