Python 3   ||   13 lines, iterative & recursive versions , w/example  ||   T/S: 90% / 99%
The iterative version:\n\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n\n        (v, h), ans = destination, \'\'   # 
The iterative version:\n```\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n\n        (v, h), ans = destination, \'\'   # Example: destination = [3, 4]   k = 16 \n\n        while h and v:          #   h      v      k      c               Ans       \n                                #  \u2013\u2013\u2013    \u2013\u2013\u2013    \u2013\u2013\u2013    \u2013\u2013\u2013              \u2013\u2013\u2013\n            c = comb(h+v-1,v)   #   4      3      16    comb(6,3) = 20   "H"\n                                #   3      3      16    comb(5,3) = 10   "HV"      \n            if c < k:           #   3      2       6    comb(4,2) =  6   "HVH"\n                ans+= \'V\'       #   2      2       6    comb(3,1) =  3   "HVHV"\n                v-= 1           #   2      1       3    comb(2,1) =  2   "HVHV"\n                k-= c           #   2      0       1                     "HVHVV"\n            else: \n                ans+= \'H\'       #   return "HVHVV" + "H"*2 = "HVHVVHH"\n                h-= 1\n          \n        if not h: ans+= \'V\'*v\n        if not v: ans+= \'H\'*h    \n        \n        return ans\n```\n[https://leetcode.com/problems/kth-smallest-instructions/submissions/903074964/](https://leetcode.com/problems/kth-smallest-instructions/submissions/903074964/)\n\nI could be wrong, but I think that time complexity is *O*(*N*) and space complexity is *O*(*N*), in which *N* ~ the sum of the values in the destination list.\n\n_______\n\nThe recursive version:\n```\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n\n        v, h = destination\n\n        def dp(h: int,v: int,k: int)-> str:\n\n            if not h: return \'V\'*v\n            if not v: return \'H\'*h\n\n            c = comb(h+v-1,v)\n\n            if c < k: return \'V\' + dp(h  ,v-1,k - c)\n            else    : return \'H\' + dp(h-1,v  ,k)\n        \n        return dp(h,v,k)\n```
['Python3']