378. Kth Smallest Element in a Sorted Matrix

Description

Link

Soluton

两种solution: pq 或者binary search

Solution 1 PQ

Add maintain a min heap and add all elements on the first row.

do k - 1 time to pop the top and add the one at the same col but next row

Solution

Do a value binary search on the matrix

Solution

Reference

https://leetcode.com/problems/wiggle-subsequence/discuss/84887/C++-0ms-O(N)-dynamic-programming-solution

results matching ""

    No results matching ""