Arm Yourself with Data Structures

Santa Clara, Oct 30, 2021

LC 480 Sliding Window Median

Given an array of n numbers and a sliding window of size k (k≤n) moving from the left to the right of the array, return the medians of the numbers in the window at each time.

LeetCode 480 in Rust

LC 803 Bricks Falling When Hit

There is an m x n binary grid, in which 1 represents a brick and 0 represents an empty space. A brick is stable if it’s either at the first row or adjacent to another stable brick in its four directions. Every time we hit a cell in the grid, the brick in that cell (if there’s one) would disappear, and some other bricks could become unstable because of the disappeared brick and thus fall. Given the sequence of cells to hit, return the number of falling bricks after each hit in order.

LeetCode 803 in Rust

LC 336 Palindrome Pairs

Given an array of unique words, return all the pairs of the distinct indices (i, j) such that words[i]+words[j] is a palindrome.

LeetCode 336 in Rust

LC 850 Rectangle Area II

Calculate the total area in the plane covered by an array of axis-aligned rectangles. An area covered by multiple rectangles should be counted only once.

LeetCode 850 in Rust

--

--

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
Devin Z

Devin Z

认识世界,改造世界 (Seek truth and solve problems)