Some of my favorite problems on LeetCode.

Image Source: LeetCode.com

LeetCode is an excellent website for practicing programming skills and preparing tech interviews. In this post, I will share with you 10 interesting problems from LeetCode about array or string algorithms. Most of them are concise in description but not intuitive for one to come up with the best solution at once. Meanwhile, the ideas and techniques used in these problems are applicable to many other similar ones.

LC 373 Find K Pairs with Smallest Sums

Given two sorted integer arrays A and B, find the k pairs of (A[i], B[j]) with the smallest sums, where 0≤i<|A|, 0≤j<|B|.

Apparently, the possible…


DP, POMDP, RL, and where you could learn more.

Unified View of Reinforcement Learning (image source: [1])

Computer programmers are obsessed with determinism. We’d think of the world as a state machine, whose next state solely depends on its current state and the action we take. Such a world is enjoyably predictable and everything could be perfectly planned to our advantage. Yet life is not that easy. We are surrounded by a huge amount of uncertainty, from variations of stock prices to the occurrence of a global pandemic.

Such reality calls for the Markov decision process (MDP), a simple but powerful model to help us describe sequential decision making in a stochastic environment. Formally, an MDP consists…

Devin Zuo

Software Engineer, Bookworm

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store