The Face That Breaks the Bank
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given a list of rounds (each round a list of face values in 1..6) and a threshold integer, accumulate per-face totals across all rounds: every time a face value f appears in any round, add f to that face's running total. Return {face: total} for the face with the highest cumulative total, provided that total strictly exceeds the threshold; otherwise return {}. Tie-break by smallest face value. The face key in the returned dict is the stringified face value (e.g. "6"), and the value is its integer total.
Summary
Roll enough dice and one number always runs away with it.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.