3421. Count Pairs That Form a Complete Day I
My accepted Python solution to LeetCode problem 3421, Count Pairs That Form a Complete Day I, running in 11ms.
- Difficulty: Easy
- Python
- Runtime 11ms
- Memory 17.3MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 11ms, memory 17.3MB, accepted 2025-12-30.
class Solution:
def countCompleteDayPairs(self, hours: List[int]) -> int:
count = 0
n = len(hours)
for i in range(n):
for j in range(i + 1, n):
if (hours[i] + hours[j]) % 24 == 0:
count += 1
return count