Loading...
The Line Cutter
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior, mid
Problem
A priority queue validator needs to check that all high-priority tokens were processed before any low-priority tokens. Given a string and two characters a and b, return True if every occurrence of character a appears before every occurrence of character b. Empty strings and strings without both characters return True.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.