<p>An&nbsp;integer has <em>sequential digits</em> if and only if each digit in the number is one more than the previous digit.</p>

<p>Return a <strong>sorted</strong> list of all the integers&nbsp;in the range <code>[low, high]</code>&nbsp;inclusive that have sequential digits.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre><strong>Input:</strong> low = 100, high = 300
<strong>Output:</strong> [123,234]
</pre><p><strong class="example">Example 2:</strong></p>
<pre><strong>Input:</strong> low = 1000, high = 13000
<strong>Output:</strong> [1234,2345,3456,4567,5678,6789,12345]
</pre>
<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>10 &lt;= low &lt;= high &lt;= 10^9</code></li>
</ul>

class Solution {
public:
    vector<int> sequentialDigits(int low, int high) {
        std::vector<int> numbers;
        std::string digits = "123456789";
      
        for (int length = 2; length <= 9; length++) {
            for (int i = 0; i <= 9 - length; ++i) {
            // Substring gives the sequential number as a string
                string seq_str = digits.substr(i, length);
                int num = stoi(seq_str);  // Convert to integer
                // Check if the number is within the given range
                if (num >= low && num <= high) {
                    numbers.push_back(num);
                }
            }
        }
        std::sort(numbers.begin(), numbers.end());
        return numbers;      
    }
};
7700