[LeetCode] Median of Two Sorted Arrays (More elegant solution)

I have written a solution for this question before: //www.lifeincode.net/programming/leetcode-median-of-two-sorted-arrays-java/ That solution seems easy to understand. However, it turns out to be very difficult to implement. The hardest part is how we come up with a correct way to handle borders. After reading some post, I found there is another way to achieve findKth number from two … Read more

Reading Notes for [All Abroad the Databus! – Linkedin’s Scalable Consistent Change Data Capture Platform]

Why do we need Databus? There is no one type of data management system that meets every needs. In most cases we will have a primary source-of-truth system and some other data systems. But we need to maintain the consistency between the primary system and other systems. There are two possible type of solutions: Application-driven … Read more

Reading Notes for [On Brewing Fresh Espresso: LinkedIn’s Distributed Data Serving Platform]

Why Espresso? RDBMS has some shortages and it costs a lot both in terms of licensing and hardware costs. Relational Database installation requires costly, specialized hardware and extensive caching to meet scale and latency requirements. Adding capacity requires a long planing cycle. Cannot do it with 100% uptime. Data model (Or schema) don’t readily map … Read more

Reading Notes for [Kafka, a Distributed Messaging System for Log Processing]

Why Kafka? Lots of “log” data generated every day, including user activities like login, page views, clicks, likes, and other queries machine metrics like CPU, memory usage. This is not only for offline analytics, but also very useful in online services. Usage may includes search relevance recommendation performance ad targeting and reporting security things. The traditional … Read more

Find two missing numbers from 1 to N

In the last post, I have mentioned that I want to write the solution for finding two missing numbers from 1 to N. It has been several months(almost half year, how time flies) and finally I have time to write it down. Problem description: Find two missing number from 1 to N Given an array of … Read more

Find one missing number from 1 to N

Find one missing number from 1 to N Given an array of size N-1, containing integer numbers from 1 to N, but there is one number missing. Return the missing number. Analysis Assuming the array given is A[], it’s easy to get N since we have the size of the array: N = A.length + 1. … Read more

[LeetCode] Palindrome Partitioning I and II(Java)

Palindrome Partitioning Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = “aab”, Return

Palindrome Partitioning II Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = “aab”, … Read more