Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sequentially check the conditions 1 through 4, and return the outcome corresponding to the first met condition.
Solve with full IDE support and test cases