Check Refill Needed
This problem is based on a simple refill check, like looking at the water level in a dispenser or soap container. You want to know whether the level is still okay or whether it is time to refill it.
You are given the current level and the minimum safe level. If the current level is less than or equal to the minimum, print REFILL. Otherwise, print OK.
For example, if the current level is 3 and the minimum safe level is 5, the answer is REFILL. But if the current level is 8, the answer is OK.
So the task is to compare the current level with the safe threshold and print the correct message.
Example Input & Output
Matching the minimum level still counts as refill time.
The level is still comfortably above the minimum.
The current level is already below the safe threshold.
Algorithm Flow

Solution Approach
A simple way to solve this is to make one comparison.
First, read the current level and the minimum safe level. Then check whether the current level is less than or equal to the minimum.
The condition is:
If that condition is true, the level is too low, so you print REFILL.
If that condition is false, the level is still fine, so you print OK.
This problem is just a threshold check, which makes it a nice short practice problem for conditionals.
Best Answers
Solutions Coming Soon
Verified best solutions for this Challenge are still being analyzed and will be available soon.
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this Challenge.
