1643. Kth Smallest Instructions
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
from math import comb

class Solution:
    def kthSmallestPath(self, destination, k):
        a, b = destination
        result = []
        k -= 1

        while a > 0 or b > 0:
            if b > 0:
                count = comb(a + b - 1, b - 1)
            else:
                count = 0

            if k < count:
                result.append('H')
                b -= 1
            else:
                result.append('V')
                k -= count
                a -= 1

        return "".join(result)

```
['Python3']