Intro

A personal problem archive — algorithms, single-cell biology, research design, one problem at a time.

Problems

# Title Category Description Solution Added
1 Two Sum algorithm Given an array of integers and a target find two numbers that add up to the target solution 2026-04-14
2 Best Time to Buy and Sell Stock algorithm Given daily stock prices find the maximum profit from one buy and one sell solution 2026-04-16
3 Binary Search algorithm Given a sorted array and a target find the target index or return -1 solution 2026-04-17
4 Valid Anagram algorithm Given two strings determine whether they contain the same characters with the same counts solution 2026-04-20
5 Valid Parentheses algorithm Given a string of brackets determine whether every bracket is closed in the correct order solution 2026-04-21
6 Merge Two Sorted Lists algorithm Given two sorted linked lists merge them into one sorted linked list solution 2026-04-22
7 Contains Duplicate algorithm Given an array of integers determine whether any value appears at least twice solution 2026-04-23
8 Valid Palindrome algorithm Given a string determine whether it reads the same forward and backward after removing non-alphanumeric characters and ignoring case solution 2026-04-24
9 Maximum Subarray algorithm Given an integer array find the contiguous subarray with the largest sum and return that sum solution 2026-04-27
10 Move Zeroes algorithm Given an integer array move all zeroes to the end while keeping the relative order of non-zero elements solution 2026-04-28
11 Climbing Stairs algorithm Given a staircase with n steps count how many distinct ways you can climb it when each move is 1 or 2 steps solution 2026-04-29
12 First Bad Version algorithm Given n product versions and an API that identifies bad versions find the first bad version solution 2026-05-05
13 Roman to Integer algorithm Given a roman numeral convert it to an integer solution 2026-05-06
14 Reverse Linked List algorithm Given the head of a singly linked list reverse the list and return the new head solution 2026-05-07
15 Linked List Cycle algorithm Given the head of a linked list determine whether the list contains a cycle solution 2026-05-08
16 Middle of the Linked List algorithm Given the head of a singly linked list return the middle node solution 2026-05-11
17 Plus One algorithm Given a non-empty array of digits representing a non-negative integer add one to the integer solution 2026-05-12
18 Invert Binary Tree algorithm Given the root of a binary tree invert the tree and return its root solution 2026-05-20
19 Maximum Depth of Binary Tree algorithm Given the root of a binary tree return its maximum depth solution 2026-05-21
20 Same Tree algorithm Given the roots of two binary trees determine whether they are structurally identical and have the same node values solution 2026-05-22
21 Symmetric Tree algorithm Given the root of a binary tree determine whether it is a mirror of itself solution 2026-05-26
22 Subtree of Another Tree algorithm Given the roots of two binary trees determine whether one tree contains the other as a subtree solution 2026-05-26
23 Balanced Binary Tree algorithm Given the root of a binary tree determine whether it is height-balanced solution 2026-05-27
24 Diameter of Binary Tree algorithm Given the root of a binary tree return the length of the longest path between any two nodes solution 2026-05-28
25 Minimum Depth of Binary Tree algorithm Given the root of a binary tree return its minimum depth solution 2026-05-29
26 Path Sum algorithm Given the root of a binary tree and a target sum determine whether any root-to-leaf path sums to the target solution 2026-06-01
27 Binary Tree Paths algorithm Given the root of a binary tree return all root-to-leaf paths as strings solution 2026-06-02
28 Sum of Left Leaves algorithm Given the root of a binary tree return the sum of all left leaf values solution 2026-06-03

Not every problem has an obvious answer — and that’s the point. Each one is a small mystery waiting to be solved, one clue at a time. The archive grows slowly, but so does the intuition behind it. No rush. Sherlock didn’t solve cases in a day either.