Combinatorics with Linear Runtime - Python
\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n        V, H = destination\n        n = H + V\n        res = ""\n     
```\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n        V, H = destination\n        n = H + V\n        res = ""\n        for i in range(1, n+1):\n            if H == 0 or V == 0:\n                res += "V"*V + "H"*H\n                break\n                \n            if k <= math.comb(H-1+V, H-1):\n                res += "H"\n                H -= 1\n            else:\n                res += "V"\n                k -= math.comb(H-1+V, H-1)\n                V -= 1\n                \n        return res\n```
['Combinatorics']