Rust with combinatorics
Approach\n1. With a variable combi to keep track of the number of "paths remaining if \'H\' is chosen".\n\n2. Initial value of combi is nCr, where n is dest[0] 
# Approach\n1. With a variable `combi` to keep track of the number of "*paths remaining if \'H\' is chosen*".\n\n2. Initial value of `combi` is `nCr`, where `n` is `dest[0] + dest[1] - 1` and `r` is `dest[0]`.\n\n3. After each step, `combi` needs to be updated efficiently, using the help of the current values of `n` and `r`.\n\n# Complexity\n- Time complexity: $$O(n)$$\n- Space complexity: $$O(1)$$\n# Code\n```\nimpl Solution {\n    pub fn kth_smallest_path(destination: Vec<i32>, mut k: i32) -> String {\n        let mut r = destination[0];\n        let mut n = r + destination[1] - 1;\n        let mut combi = 1;\n        for i in 1..=r {\n            combi = combi * (n - r + i) / i;\n        }\n        let mut ans = String::with_capacity(n as usize + 1);\n        for _ in 0..n {\n            if k > combi {\n                ans.push(\'V\');\n                k -= combi;\n                combi = combi * r / n;\n                n -= 1;\n                r -= 1;\n            }\n            else {\n                ans.push(\'H\');\n                combi = combi * (n - r) / n;\n                n -= 1;\n            }\n        }\n        ans.push(if combi == 1 { \'H\' } else { \'V\' });\n        ans\n    }\n}\n```
['Combinatorics', 'Rust']