Why (a, b) -> a - b Is a Bug in Java Comparators
If you've solved enough LeetCode problems in Java, you've written this: PriorityQueue<Integer> minHeap = new PriorityQueue<>((a, b) -> a - b); PriorityQueue<Integer> maxHeap = new PriorityQueue<>((a,

Series
Interview-ready DSA and Java pitfalls, with code you can run.