✔ Python3 Solution | Combination
Solution - 1\nPython\nclass Solution:\n    def kthSmallestPath(self, D, K):\n        K -= 1\n        V, H = D\n        ans = \'\'\n        while K and H and V:\
# Solution - 1\n```Python\nclass Solution:\n    def kthSmallestPath(self, D, K):\n        K -= 1\n        V, H = D\n        ans = \'\'\n        while K and H and V:\n            C = comb(H + V - 1, H - 1)\n            if C <= K:\n                ans, V, K = ans + \'V\', V - 1, K - C\n            else:\n                ans, H = ans + \'H\', H - 1\n        return ans + \'H\' * H + \'V\' * V\n```\n\n# Solution - 2\n```Python\nclass Solution:\n    def kthSmallestPath(self, D, K):\n        K -= 1\n        V, H = D\n        C = comb(H + V - 1, H - 1)\n        ans = \'\'\n        while K and H and V:\n            if C <= K:\n                ans, V, K = ans + \'V\', V - 1, K - C\n                C *= (V + 1)\n            else:\n                ans, H = ans + \'H\', H - 1\n                C *= H\n            C //= (V + H)\n        return ans + \'H\' * H + \'V\' * V\n```
['Math', 'Combinatorics', 'Python3']