Water jug measurement
Your task
You have two jugs with capacities jug1 and jug2 liters (non-negative integers). You may fill a jug completely, empty a jug, or pour from one jug into the other until either the source is empty or the destination is full. Return True if it is possible to measure exactly target liters of water in total across the two jugs, otherwise False. Capacities and target are at most 10^9.
Examples
water_jug_reachable(jug1: int, jug2: int, target: int) -> boolExample 1
Input
water_jug_reachable(3, 5, 4)Output
True