Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a464cde

Browse files
add 1439
1 parent 6cc532c commit a464cde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/fishercoder/solutions/_1439.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public static class Solution1 {
1313
* 2. priority queue doesn't help in this case unless used in combination with a set to filter out duplicates;
1414
* 3. implement a customized comparator for treeset: if sum i.e. entry[0] doesn't equal, then it's not a duplicate,
1515
* then we compare the rest of the elements in the array, as long as anyone of them differs at the same index, it's not a duplicate.
16+
*
17+
* Again, using a pen and paper to visualize my thought process helps a lot!
1618
*/
1719
public int kthSmallest(int[][] mat, int k) {
1820
TreeSet<int[]> treeSet = new TreeSet<>(new Comparator<int[]>() {

0 commit comments

Comments
 (0)