Apply Brakes
EasyP3Coding
A vehicle covers distance in time, so its speed is distance / time. Return "Apply Brake" if the speed is strictly greater than 40, otherwise return "Keep Going".
Example 1
- Input
- distance = 100, time = 2
- Output
- "Apply Brake"
- Why
- Speed is 50, above 40.
Example 2
- Input
- distance = 80, time = 2
- Output
- "Keep Going"
- Why
- Speed is exactly 40, which is not above 40.
Example 3
- Input
- distance = 40, time = 1
- Output
- "Keep Going"
Constraints
- 0 <= distance <= 10^6
- 1 <= time <= 10^4
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 8. ⌘Enter runs, ⌘⇧Enter submits.