This question evaluates algorithmic problem-solving skills across two areas: efficient seat-allocation and interval occupancy reasoning for grouping in a constrained seating layout, and robust string processing with phrase-based, case-insensitive matching and mapping to ticker identifiers.
Implement the following two coding tasks.
You are given an integer n representing the number of rows in a movie theater. Each row has seats 1 through 10. Some seats are already reserved, represented as pairs (row, seat).
A group of 4 people can be seated together only if all 4 seats are in the same row and fit entirely in one of these seat blocks:
2-5
4-7
6-9
Return the maximum number of 4-person groups that can still be seated.
Assume:
1 <= row <= n
You are given:
Write a function that returns all tickers mentioned in the headline.
Requirements:
Example: if AAPL -> ["apple", "apple inc"] and TSLA -> ["tesla"], then the headline "Apple Inc. rises after Tesla delivery report" should return ["AAPL", "TSLA"].