Solve various LeetCode data-structure questions
Company: Meta
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Overview: This collection evaluates proficiency in fundamental data structures and algorithms — including tree traversal and binary search tree reasoning, array manipulation and counting, string/stack validation for parentheses, prefix-sum range queries, and basic dynamic programming — within the Coding & Algorithms domain.
Constraints
- 1 <= len(nums) <= 100000
- -10^9 <= nums[i] <= 10^9
- -10^9 <= target <= 10^9
- Return indices in increasing order
Hints
- Sorting nums and scanning for target works in O(n log n).
- You can avoid sorting: count how many elements are less than target and how many equal target.
- If cLess is the count of elements < target and cEq is the count == target, the answer is the range [cLess, cLess + cEq - 1].