Given a string array where each string represents employee chair events:
Characters represent actions:
Task: Calculate minimum chairs needed to purchase.
Example: Input: ["C", "U", "L", "R"] Output: 1
Rules:
Note: Need to buy chair immediately when needed (can't wait for future events).
Calculate minimum initial health needed to defeat opponents in a game.
Requirements:
Example:
initial_players = [3, 2, 4]
next_players = [[1, 5], [2]]
rank = 2
Solution approach:
- Maintain min heap of size 'rank'
- Track health changes after each battle
- Consider new players added each level
Implement a Sudoku validator and solver.
Part 1: Validation
Part 2: Solver
Follow-up:
Implement a wildcard pattern matching function.
Requirements:
Examples:
pattern: "a*b", string: "acb" → true
pattern: "a*", string: "abc" → true
pattern: "a*c", string: "ab" → false
Follow-up: