feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -11,6 +11,24 @@ categories:
patterns:
- sliding-window
function_signature: "def alert_names(key_name: list[str], key_time: list[str]) -> list[str]:"
test_cases:
visible:
- input: { key_name: ["daniel", "daniel", "daniel", "luis", "luis", "luis", "luis"], key_time: ["10:00", "10:40", "11:00", "09:00", "11:00", "13:00", "15:00"] }
expected: ["daniel"]
- input: { key_name: ["alice", "alice", "alice", "bob", "bob", "bob", "bob"], key_time: ["12:01", "12:00", "18:00", "21:00", "21:20", "21:30", "23:00"] }
expected: ["bob"]
hidden:
- input: { key_name: ["a", "a", "a"], key_time: ["01:00", "01:30", "02:00"] }
expected: ["a"]
- input: { key_name: ["a", "b", "c"], key_time: ["01:00", "02:00", "03:00"] }
expected: []
- input: { key_name: ["a", "a", "a", "b", "b", "b"], key_time: ["00:00", "00:30", "01:00", "23:00", "23:30", "23:59"] }
expected: ["a", "b"]
- input: { key_name: ["john", "john", "john"], key_time: ["08:00", "09:01", "10:00"] }
expected: []
description: |
LeetCode company workers use key-cards to unlock office doors. Each time a worker uses their key-card, the security system saves the worker's name and the time when it was used. The system emits an **alert** if any worker uses the key-card **three or more times** in a one-hour period.