Modify the code so that the tap only stays open for a fixed time (e.g., 5 seconds) even if hands remain in place. This prevents wasting water.
Real-World Applications
- Public washrooms for hygiene and water conservation.
- Automated garden watering systems.
- Factory machines that stop when no product is detected.