def calculate_coordinates(pth):
    """
    Create a set of tuples representing the coordinates that the path
    traverses, with a starting point at (0,0)
    """
    x = 0
    y = 0
    coords = set()
    for instruction in pth:
        direction = instruction[:1]
        distance = int(instruction[1:].strip())
        if direction.lower() == "d":
            for _ in range(distance):
                y -= 1
                coords.add((x, y))
        elif direction.lower() == "u":
            for _ in range(distance):
                y += 1
                coords.add((x, y))
        elif direction.lower() == "l":
            for _ in range(distance):
                x -= 1
                coords.add((x, y))
        elif direction.lower() == "r":
            for _ in range(distance):
                x += 1
                coords.add((x, y))
        else:
            raise Exception(f"Unknown direction {direction}")
    
    return coords