check my code int dequeue(int queue[], int &size, int val) {
    if (size == 0) {
        return 1; // Queue underflow
    }

    int found = 0; // Flag to indicate if the target value was found
    int shiftIndex = 0; // Index for shifting elements

    for (int i = 0; i < size; ++i) {
        if (queue[i] == val) {
            found = 1; // Mark the value as found
        }

        if (found) {
            if (i < size - 1) {
                queue[i] = queue[i + 1]; // Shift elements left
            }
        } else {
            if (queue[i] == val) {
                found = 1; // Mark the value as found
            }
        }
    }

    if (found) {
        size--; // Decrease the size by one when the target value is found
        return 0; // Return 0 for success
    }

    return 2; // Value not found in the queue
}