⚡ Build the skills to land top-paying quant jobs. Offer ends in 25d 09h 52m 06s25 days 9 hours 52 minutes 6 seconds.
You have a 3-litre jug and a 5-litre jug (no markings) and an unlimited water supply. One operation is one of: completely fill a jug from the tap, completely empty a jug, or pour from one jug into the other until the source is empty or the target is full. What is the minimum number of operations needed to have exactly 4 litres in the 5-litre jug?