I have a coding scenario, where I need to validate some inputs based on some rules. For eg the rules may look like