Array
3116. Kth Smallest Amount With Single Denomination Combination
An amount is reachable when it is a multiple of at least one coin, so the k-th smallest reachable value is monotone in a counting function: how many valid amounts sit at or below a given x. That monotonicity is what lets me binary-search the answer instead of enumerating multiples one by one.
Loading…