Tap here to switch tabs
Problem
Submissions

Problem: Traffic Signal Color

med
30 min
Try to solve the Traffic Signal Color problem.

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

med
30 min
Try to solve the Traffic Signal Color problem.

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