mediumHashingPattern: Mixed

Expiring Item Filter Solution

Problem Statement

Given a list of items, each associated with an expiration date, implement a function that identifies and returns the items that are due to expire on the current date.

Examples

Example 1:
Input:[["Milk","2024-09-17"],["Eggs","2024-09-20"],["Bread","2024-09-17"]]
Output:["Milk","Bread"]
Explanation: Items with expiration dates equal to the current date (2024-09-17) are discarded.

Constraints

  • All expiration dates will be in the format YYYY-MM-DD.
  • The input list will be in the format ['item', 'expiration date', ...].
  • The output list will contain strings in the format 'item'.
Time: O(n) Space: O(n)
Analyze constraints and compute optimal solutions step-by-step.

Run, Test & Submit Code

Ready to practice this challenge? Launch our interactive compilation environment with compiler validation.

Solve on Interactive Workspace

Tested Solutions

No solution code is currently loaded.
Complete this code in the workspace editor.