Tap here to switch tabs
Problem
Submissions

Problem: Traffic Signal Color

Traffic Signal Color asks you to classify an integer timer as Green at zero, Orange at thirty, Red above thirty through ninety, or Invalid otherwise.

Statement

Given an integer timer, determine the state of the traffic signal based on the following rules:

  • Return "Green" if timer is equal to 00.

  • Return "Orange" if timer is equal to 3030.

  • Return "Red" if 30<30 < timer ≤90\leq 90.

  • Return "Invalid" if timer does not satisfy any of the above conditions.

Constraints:

  • 0≤0 \leq timer ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Traffic Signal Color

Traffic Signal Color asks you to classify an integer timer as Green at zero, Orange at thirty, Red above thirty through ninety, or Invalid otherwise.

Statement

Given an integer timer, determine the state of the traffic signal based on the following rules:

  • Return "Green" if timer is equal to 00.

  • Return "Orange" if timer is equal to 3030.

  • Return "Red" if 30<30 < timer ≤90\leq 90.

  • Return "Invalid" if timer does not satisfy any of the above conditions.

Constraints:

  • 0≤0 \leq timer ≤1000\leq 1000