πŸ“ Problem Details

πŸ’­What Were My Initial Thoughts?

simple / brute force approach is acceptable in this case since the max length of the array is 100

πŸ€”What Did I Struggle With?

~

πŸ’‘ Explanation of Solution

- nested for loop that has i start at 0 and j start at i + 1
- check if the sum of nums[i] and nums[j] is a multiple of 24
- increment a counter variable and return it 

βŒ› Complexity Analysis

Time Complexity: O(n^2)
Space Complexity: O(1)

πŸ’» Implementation of Solution

class Solution {
public:
    int countCompleteDayPairs(vector<int>& hours) {
        
        int count = 0;
 
        for(int i=0; i < hours.size(); i++) {
            for(int j = i+1; j < hours.size(); j++) {
                if ((hours[i] + hours[j]) % 24 == 0) count++;
            }
        }
 
        return count;
    }
};