from typing import List, Optional, Tuple, Dict, Set
from collections import defaultdict, Counter, deque
import heapq
import math
import bisect
import itertools
import functools


class Solution:
    def sequentialDigits(self, low, high):
        out = []
        queue = deque(range(1, 10))
        while queue:
            elem = queue.popleft()
            if low <= elem <= high:
                out.append(elem)
            last = elem % 10
            if last > 9:
                queue.append(elem * 10 + last + 1)

        return out
