<p>You are given two jugs with capacities <code>jug1Capacity</code> and <code>jug2Capacity</code> liters. There is an infinite amount of water supply available. Determine whether it is possible to measure exactly <code>targetCapacity</code> liters using these two jugs.</p>
<p>If <code>targetCapacity</code> liters of water are measurable, you must have <code>targetCapacity</code> liters of water contained <strong>within one or both buckets</strong> by the end.</p>
<p>Operations allowed:</p>
<ul>
<li>Fill any of the jugs with water.</li>
<li>Empty any of the jugs.</li>
<li>Pour water from one jug into another till the other jug is completely full, or the first jug itself is empty.</li>
<strong>Explanation:</strong> The famous <ahref="https://www.youtube.com/watch?v=BVtQNK_ZUJg&ab_channel=notnek01"target="_blank">Die Hard</a> example