Tap here to switch tabs
Problem
Submissions

Problem: Count Pairs That Form a Complete Day I

Count Pairs That Form a Complete Day I asks you to count pairs of durations in an array whose total is an exact multiple of 24 hours, using each pair of distinct indices once.

Statement

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

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

Constraints:

  • 1≤1 \leq hours.length ≤100\leq 100

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Pairs That Form a Complete Day I

Count Pairs That Form a Complete Day I asks you to count pairs of durations in an array whose total is an exact multiple of 24 hours, using each pair of distinct indices once.

Statement

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

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

Constraints:

  • 1≤1 \leq hours.length ≤100\leq 100

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