Tap here to switch tabs
Problem
Submissions

Problem: Count Pairs That Form a Complete Day II

Count Pairs That Form a Complete Day II asks you to count index pairs in an hours array whose durations add up to an exact multiple of 24 hours, with the first index earlier.

Statement

Given an integer array hours representing durations in hours, determine the number of index pairs (i,j)(i, j) such that i<ji < j and hours[i] + hours[j] forms a complete day.

A complete day is defined as any duration of time that is an exact integer multiple of 2424 hours.

Constraints:

  • 1≤1 \leq hours.length ≤5imes105\leq 5 imes 10^5

  • 1≤1 \leq hours[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Pairs That Form a Complete Day II

Count Pairs That Form a Complete Day II asks you to count index pairs in an hours array whose durations add up to an exact multiple of 24 hours, with the first index earlier.

Statement

Given an integer array hours representing durations in hours, determine the number of index pairs (i,j)(i, j) such that i<ji < j and hours[i] + hours[j] forms a complete day.

A complete day is defined as any duration of time that is an exact integer multiple of 2424 hours.

Constraints:

  • 1≤1 \leq hours.length ≤5imes105\leq 5 imes 10^5

  • 1≤1 \leq hours[i] ≤109\leq 10^9