Solve LeetCode array & stream problems
Company: Meta
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Overview: This set of problems evaluates proficiency in array and string manipulation, stream processing, order-preserving deduplication, stability-aware sorting, and analysis of time/space complexity within the Coding & Algorithms domain.
Constraints
- 1 <= len(strings) <= 10^4
- 1 <= len(s) <= 20 for each s in strings
- strings[i] consists only of lowercase English letters 'a' to 'z'
- Output ordering: sort each group lexicographically; then sort groups by each group's first string
- Duplicates in input are preserved in their respective groups
Hints
- Two strings belong to the same group if their sequences of consecutive letter differences modulo 26 are identical.
- All single-character strings share the same signature (empty difference sequence).
- Use a hash map from signature to list of strings; then sort each bucket and sort the buckets by their first element.