Skip to content

Practice Count Pairs That Form a Complete Day II

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#3185
LeetCode Problem

Count Pairs That Form a Complete Day II

Problem Statement

Given an integer array hours representing times in hours, return an integer denoting the number of pairs i, j where i < j and hours[i] + hours[j] forms a complete day. A complete day is defined as a time duration that is an exact multiple of 24 hours. For example, 1 day is 24 hours, 2 days is 48 hours, 3 days is 72 hours, and so on.

Source: Count Pairs That Form a Complete Day II on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
hours = [12,12,30,24,24]
Output
2

# Example 2

Input
hours = [72,48,24,3]
Output
3

Constraints

1 <= hours.length <= 5 * 10^5
1 <= hours[i] <= 10^9

Related LeetCode Problems

Practice more problems similar to Count Pairs That Form a Complete Day II.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.