Skip a Beat
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Problem
You're picking which slots to run on a single worker that needs a cooldown between jobs, so two back-to-back slots can never both run. Given `payoffs`, the value of each slot in order, return the most total value you can collect without ever choosing two adjacent slots.
Summary
Two in a row is never allowed. Collect the most from what remains.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.