3184. Count Pairs That Form a Complete Day I Easy

@problem@discussion
#Array#Hash Table#Counting



1/**
2 * [3184] Count Pairs That Form a Complete Day I
3 *
4 * 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.
5 * A complete day is defined as a time duration that is an exact multiple of 24 hours.
6 * For example, 1 day is 24 hours, 2 days is 48 hours, 3 days is 72 hours, and so on.
7 *  
8 * <strong class="example">Example 1:
9 * <div class="example-block">
10 * Input: <span class="example-io">hours = [12,12,30,24,24]</span>
11 * Output: <span class="example-io">2</span>
12 * Explanation:
13 * The pairs of indices that form a complete day are (0, 1) and (3, 4).
14 * </div>
15 * <strong class="example">Example 2:
16 * <div class="example-block">
17 * Input: <span class="example-io">hours = [72,48,24,3]</span>
18 * Output: <span class="example-io">3</span>
19 * Explanation:
20 * The pairs of indices that form a complete day are (0, 1), (0, 2), and (1, 2).
21 * </div>
22 *  
23 * Constraints:
24 * 
25 * 	1 <= hours.length <= 100
26 * 	1 <= hours[i] <= 10^9
27 * 
28 */
29pub struct Solution {}
30
31// problem: https://leetcode.com/problems/count-pairs-that-form-a-complete-day-i/
32// discuss: https://leetcode.com/problems/count-pairs-that-form-a-complete-day-i/discuss/?currentPage=1&orderBy=most_votes&query=
33
34// submission codes start here
35
36impl Solution {
37    pub fn count_complete_day_pairs(hours: Vec<i32>) -> i32 {
38        0
39    }
40}
41
42// submission codes end
43
44#[cfg(test)]
45mod tests {
46    use super::*;
47
48    #[test]
49    fn test_3184() {
50    }
51}
52


Back
© 2025 bowen.ge All Rights Reserved.