Alan Zhan Blog

Live for nothing, or die for something

Plain English Leetcode - 23 Merge k Sorted Lists

23. Merge k Sorted Lists https://leetcode.com/problems/merge-k-sorted-lists/ HardYou are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the …

Plain English Leetcode - 200 Number of Islands

200. Number of Islands https://leetcode.com/problems/number-of-islands/ MediumGiven an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. …

Plain English Leetcode - 78 Subsets

78. Subsets https://leetcode.com/problems/subsets/ MediumGiven an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate …

Plain English Leetcode - 111 Minimum Depth of Binary Tree

111. Minimum Depth of Binary Tree https://leetcode.com/problems/minimum-depth-of-binary-tree/ EasyGiven a binary tree, find its minimum depth. The minimum depth is the number of nodes along the …

Plain English Leetcode - 104 Maximum Depth of Binary Tree

104. Maximum Depth of Binary Tree https://leetcode.com/problems/maximum-depth-of-binary-tree/ EasyGiven the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the …

How to Survive in a Winner-Take-All Workplace

“Winner takes all” — the meaning is pretty clear from the phrase itself, and it happens constantly in our lives. Here’s a simple example: in a democratic society, there’s a …

Plain English Leetcode - 226 Invert Binary Tree

226. Invert Binary Tree https://leetcode.com/problems/invert-binary-tree/ EasyGiven the root of a binary tree, invert the tree, and return its root.   Example 1: Input: root = [4,2,7,1,3,6,9] …

Kubernetes Core Component: Scheduler

Strictly speaking, the Scheduler is a special type of Controller — its working principle is no different from other controllers. The Scheduler’s special responsibility is to monitor all …

Kubernetes Core Component: API Server

API Server kube-apiserver is one of the most important core components of Kubernetes, providing the following key features: Cluster management REST API, including authentication, authorization, data …

MongoDB Index Best Practices

After the sorted operation OOM incident in production from the previous post, I realized my understanding of MongoDB indexes wasn’t as deep as it should be. I started searching extensively and …