mediumStringsPattern: TOOL RETURNED ID

Generate Anagrammed IDs Solution

Problem Statement

Given a list of strings representing tool types, a list of strings representing returned statuses, and a list of integers representing collection IDs, generate a list of unique identifiers by anagramming the concatenation of each tool type, returned status, and collection ID.

Constraints

  • 1 ≤ N ≤ 10^5
  • Each tool name has a maximum length of 10 characters
  • Each status (success/error) is exactly 8 characters long (including the spaces)
  • Each collection ID is a positive integer with up to 6 digits
Time: O(n) Space: O(n)
A more efficient approach would be to store the tool names and their corresponding IDs in a hash map. Then, use the map to generate the anagrammed IDs based on the tool name and returned status, resulting in a time complexity of O(n).

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.