Problem LeetCode 11: Container With Most Water (Medium) Problem Statement: In the coordinate plane, consider $n$ vertical lines starting at points $(1, 0), (2, 0), …, (n, 0)$ and ending at points $(1, h_1), (2, h_2), …, (n, h_n)$, where each $h_i$ is a non-negative integer. We can construct a rectangle whose sides are the […]

Continue## LeetCode 47: Permutations II

Problem LeetCode 47: Permutations II (Medium) Problem Statement: Given a list of integers that may contain duplicates, return all possible unique permutations of those integers, in any order. A permutation is an arrangement of elements. For example, the three elements [1,2,3] can be arranged into $3!=6$ unique permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. […]

Continue## LeetCode 897: Increasing Order Search Tree

Problem LeetCode 897: Increasing Order Search Tree (Easy) Problem Statement: Given a binary search tree (BST), rearrange it (preserving the BST order) so that the lowest node is at the root and each node only has a right child. The result is like a sorted linked list. The problem doesn’t mention any space requirements, and […]

Continue## LeetCode 394: Decode String

Problem LeetCode 394: Decode String (Medium) Problem Statement: Decode a string that has been encoded in a specified format. In the encoded string, k[str] means decode the string str and repeat the result k times. The input encoding is always valid: k is always a positive integer, there is no extra whitespace, the square brackets […]

Continue## LeetCode 1022: Sum of Root To Leaf Binary Numbers

Problem LeetCode 1022: Sum of Root To Leaf Binary Numbers (Easy) Problem statement: Given a binary tree where each node contains a binary digit, interpret each path from the root to a leaf as a binary number, with the root value as the high-order bit. Return the sum of these numbers. Solution This problem is […]

Continue## LeetCode 1288: Remove Covered Intervals

Problem LeetCode 1288: Remove Covered Intervals (Medium) Problem statement: Given a list of intervals, return the number of intervals that are not covered by another interval in the list. For this problem, think of an interval as a segment of the number line with integer starting and ending points. For example, the interval $(-1, 1)$ […]

Continue## LeetCode 227: Basic Calculator II

Problem LeetCode 227: Basic Calculator II (Medium) Problem statement: Evaluate a valid arithmetic expression containing only numbers, spaces, and the operators +, -, *, and /. This is almost as simple as an arithmetic expression evaluator can be. It’s simpler than the first Basic Calculator problem, which includes parentheses. The only trick in this version […]

Continue## A Project for 2021

In the geeky world of programming puzzles, programming interviews, and competitive programming (loosely defined), LeetCode is one of the major players. And on LeetCode, 2021 begins with another month of LeetCoding Challenges. In my 2020 wrap-up post last week, I described the process that I use to get the most out of these challenges. I […]

Continue## Lessons from the 2020 LeetCode Monthly Challenges

In late March of this year, the coding interview preparation site LeetCode announced a 30-Day LeetCoding Challenge. Each day during the month of April, they selected one of the coding problems from their archive and challenged developers to solve it within 24 hours. Newly locked-down developers throughout the world took up the challenge, earning LeetCoins […]

Continue## Quora: Are Math Courses Useful for Competitive Programming?

Competitive programming seems to have a lot to do with math and algorithms, so it’s reasonable to ask: Does taking more mathematics classes improve competitive programming? (answer) I’m doing most of my writing on Quora this year. For more information, see A Project for 2020.

Continue- « Previous Page
- 1
- 2
- 3
- 4
- 5
- 6
- …
- 36
- Next Page »