1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/构成整天的下标对数目 I [count-pairs-that-form-a-complete-day-i].html
2024-06-25 01:21:44 +08:00

41 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给你一个整数数组 <code>hours</code>,表示以 <strong>小时 </strong>为单位的时间,返回一个整数,表示满足 <code>i &lt; j</code><code>hours[i] + hours[j]</code> 构成 <strong>整天 </strong>的下标对&nbsp;<code>i</code>, <code>j</code> 的数目。</p>
<p><strong>整天 </strong>定义为时间持续时间是 24 小时的 <strong>整数倍 </strong></p>
<p>例如1 天是 24 小时2 天是 48 小时3 天是 72 小时,以此类推。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">hours = [12,12,30,24,24]</span></p>
<p><strong>输出:</strong> <span class="example-io">2</span></p>
<p><strong>解释:</strong></p>
<p>构成整天的下标对分别是 <code>(0, 1)</code><code>(3, 4)</code></p>
</div>
<p><strong class="example">示例 2</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">hours = [72,48,24,3]</span></p>
<p><strong>输出:</strong> <span class="example-io">3</span></p>
<p><strong>解释:</strong></p>
<p>构成整天的下标对分别是 <code>(0, 1)</code><code>(0, 2)</code><code>(1, 2)</code></p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= hours.length &lt;= 100</code></li>
<li><code>1 &lt;= hours[i] &lt;= 10<sup>9</sup></code></li>
</ul>