Your question is LeetCode-Style Coding Range. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Citadel Securities evaluates candidate trading strategy windows, where each window has a start time, end time, and expected value. Select at most k non-overlapping windows to maximize total value.
Two windows are compatible when the earlier window's end time is less than or equal to the later window's start time. Return the maximum total value.
Implement max_strategy_value(intervals, k), where intervals is a list of [start, end, value] integer records. Return an integer representing the maximum achievable value using at most k intervals.
def max_strategy_value(intervals, k):