Tap here to switch tabs
Problem
Submissions

Problem: Alert Using Same Key-Card 3 or More Times in an Hour

Try to solve the Alert Using Same Key-Card Three or More Times in a One Hour Period problem.

Statement

A company security system records badge access logs. You are given two string arrays keyName and keyTime, where keyName[i] and keyTime[i] correspond to the name of an employee and the time they used their keycard on a single day.

All access times are formatted as “HH:MM” in 2424 hour time.

An alert is raised for an employee if that employee uses their keycard 33 or more times within any rolling one hour window (which means the time difference between the first and the third use is at most 6060 minutes).

Return a list of all unique employee names who received an alert, sorted in ascending lexicographical order.

Constraints:

  • 1≤1 \leq keyName.length, keyTime.length ≤105\leq 10^5

  • keyName.length ==== keyTime.length

  • keyTime[i] is in the format “HH:MM”.

  • [keyName[i], keyTime[i]] is unique.

  • 1≤1 \leq keyName[i].length ≤10\leq 10

  • keyName[i] contains only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Alert Using Same Key-Card 3 or More Times in an Hour

Try to solve the Alert Using Same Key-Card Three or More Times in a One Hour Period problem.

Statement

A company security system records badge access logs. You are given two string arrays keyName and keyTime, where keyName[i] and keyTime[i] correspond to the name of an employee and the time they used their keycard on a single day.

All access times are formatted as “HH:MM” in 2424 hour time.

An alert is raised for an employee if that employee uses their keycard 33 or more times within any rolling one hour window (which means the time difference between the first and the third use is at most 6060 minutes).

Return a list of all unique employee names who received an alert, sorted in ascending lexicographical order.

Constraints:

  • 1≤1 \leq keyName.length, keyTime.length ≤105\leq 10^5

  • keyName.length ==== keyTime.length

  • keyTime[i] is in the format “HH:MM”.

  • [keyName[i], keyTime[i]] is unique.

  • 1≤1 \leq keyName[i].length ≤10\leq 10

  • keyName[i] contains only lowercase English letters.