Prompt: This is the Dead End problem in the movies. You are given two jugs, each with different capacity, an infinity source of water, and a target capacity. The goal is to determine if you can measure the target capacity using the two jugs. You are allowed to fill each of the jugs with the infinite source of water, discard all water from the jugs, or transfer water from jug to jug.

Example:

Input: jug1Capacity = 3, jug2Capacity = 5, targetCapacity = 4
Output: true
Explanation: The famous [Die Hard](https://www.youtube.com/watch?v=BVtQNK_ZUJg&ab_channel=notnek01) example 

Solution: First, we can identify the range of capacities that can be measured by the two jugs is from 0 to jug1Capacity + jug2Capacity. Knowing this, we have a search area that we would like to focus on. Then, we can either use DFS or BFS with this simple idea; if we focus on the target capacity, we know that it is measurable if one of these capacities(t-jug1Capacity, t+jug1Capacity, t-jug2Capacity, t+jug2Capacity) is measurable. We can start from i=0 and pass through these points (i-jug1Capacity, i+jug1Capacity, i-jug2Capacity, i+jug2Capacity) and see if we can reach t from 0. We can also use a memory set to remember all the points we have visited to reduce runtime. The runtime is O(n) because we are using a memory set to remember all visited points; the worst case would be that the target is not measurable so we want to search all points with the 0 to jug1Capacity + jug2Capacity range.