oneliner


  • 2
    def find_kth_number(m, n, k)
      (1..m*n).bsearch { |x| (1..m).map { |i| [x / i, n].min }.sum >= k }
    end
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.