(0, 0) and must reach cell target = [row, col]. It can only move right or down. A route is written as a string of 'H' (one step right, column + 1) and 'V' (one step down, row + 1). For instance, [1, 2] is reached by "HHV", "HVH" and "VHH".
Sort all routes to target alphabetically ('H' < 'V'). Return the route in position k (counting from 1).target=[1, 2], k=2 → 'HVH'
There are three routes, "HHV", "HVH" and "VHH"; the second in alphabetical order is "HVH".
target=[2, 2], k=6 → 'VVHH'
Of the six routes, the last alphabetically goes down twice first: "VVHH".
target=[3, 1], k=1 → 'HVVV'
target=[1, 2], k=2
'HVH'
Run checks the first 3 tests in your browser. Submit checks all 91 tests on the server, hidden ones included.