A walkthrough of "Longest Increasing Subsequence": why the natural DFS with backtracking solution blows up exponentially, and how dropping the in-progress sequence in favor of two indices makes the same recursion memoizable in O(n²) time.
A walkthrough of "Longest Increasing Subsequence": why the natural DFS with backtracking solution blows up exponentially, and how dropping the in-progress sequence in favor of two indices makes the same recursion memoizable in O(n²) time.
A deeper look at "Contains Duplicate": why the brute force and sorting approaches fall short, how a hash set gets you to linear time, and when a plain boolean array beats hashing altogether.
A walkthrough of "Two Sum": why checking every pair is wasteful, and how reframing the problem around a complement value lets a single HashMap pass find the answer in linear time.
A walkthrough of "Valid Anagram": why sorting two strings works but isn't the cheapest option, and how a character frequency count gets you to linear time with constant extra space.
A walkthrough of "Group Anagrams": why comparing every pair of strings is too slow, and how turning each word into a canonical hash-map key groups them all in linear time.
A walkthrough of "Top K Frequent Elements": why sorting by frequency costs more than it needs to, and how bucket sort gets the answer in linear time by exploiting a bound on how large a frequency can ever be.
I was implementing a searching algorithm and I had to search for two things. In this article I describe how I implemented combining two Java optionals in Java 9 using Optional.or compared with Java 8
We performed a migration to Java 11 and a bug fix about negative symbol for negative numbers in Java ruined our implementation. This article describes the situation and the lessons learned.
We have experienced an issue with UTF-8 characters in Java and we have designed a unit test to prevent that to happen again.
Working with Mockito's ArgumentCaptor I discover it does not work as expected with child classes. This article describe a workaround to keep using it.
This post describe how I setup SNS to communicate with Firebase to send push notifications to Android and iOS devices
Playing around with JVM options, we question ourselves; what would happen if we set the minimum memory to be greater than the available memory?
Mocking external API with wiremock. Prepare a docker-compose bootstrap project for wiremock.