mathportal.org

  • Math Lessons
  • Math Formulas
  • Calculators

Math Calculators, Lessons and Formulas

It is time to solve your math problem

  • HW Help (paid service)

Linear Algebra

Matrix addition and multiplication.

Matrices Definitions

Addition of Matrices

Denote the sum of two matrices $A$ and $B$ (of the same dimensions) by $C = A + B..$ The sum is defined by adding entries with the same indices

over all $i$ and $j$.

$ \left[ {\begin{array}{*{20}{c}} \color{red}{1}&\color{blue}{2}\\ 3&\color{purple}{4} \end{array}} \right] + \left[ {\begin{array}{*{20}{c}} \color{red}{5}&\color{blue}{6}\\ 7&\color{purple}{8} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {\color{red}{1 + 5}}&{\color{blue}{2 + 6}}\\ {3 + 7}&{\color{purple}{4 + 8}} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} 6&8\\ {10}&{12} \end{array}} \right] $

Subtraction of Matrices

Subtraction is performed in analogous way.

$ \left[ {\begin{array}{*{20}{c}} \color{red}{1}&\color{blue}{2}\\ 3&\color{purple}{4} \end{array}} \right] - \left[ {\begin{array}{*{20}{c}} \color{red}{5}&\color{blue}{6}\\ 7&\color{purple}{8} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {\color{red}{1 - 5}}&{\color{blue}{2 - 6}}\\ {3 - 7}&{\color{purple}{4 - 8}} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {-4}&{-4}\\ {-4}&{-4} \end{array}} \right] $

Scalar multiplication

To multiply a matrix with a real number, each element is multiplied by that number.

$ \color{red}{5} \cdot \left[ {\begin{array}{*{20}{l}} 1&2&3\\ { - 1}&{ - 2}&{ - 3} \end{array}} \right] = \left[ {\begin{array}{*{20}{l}} {\color{red}{5} \cdot 1}&{\color{red}{5} \cdot 2}&{\color{red}{5} \cdot 3}\\ {\color{red}{5} \cdot ( - 1)}&{\color{red}{5} \cdot ( - 2)}&{\color{red}{5} \cdot ( - 3)} \end{array}} \right] = \left[ {\begin{array}{*{20}{l}} 5&{10}&{15}\\ { - 5}&{ - 10}&{ - 15} \end{array}} \right] $

Multiplication of a row vector by a column vector

This multiplication is only possible if the row vector and the column vector have the same number of elements. To multiply the row by the column, corresponding elements are multiplied, then added to the results.

$ \underbrace {\left[ {\begin{array}{*{20}{c}} \color{red}{1}&\color{blue}{2}&3 \end{array}} \right]}_{1 \times \color{blue}{3}} \cdot \underbrace {\left[ {\begin{array}{*{20}{c}} \color{red}{4}\\ \color{blue}{5}\\ 6 \end{array}} \right]}_{\color{blue}{3} \times 1} = \color{red}{1 \cdot 4} + \color{blue}{2 \cdot 5} + 3 \cdot 6 = \underbrace {22}_{1 \times 1} $

If the row vector and the column vector are not of the same length, their product is not defined .

$ \underbrace {\left[ {\begin{array}{*{20}{c}} 1&2&3&4 \end{array}} \right]}_{1 \times \color{red}{4}} \cdot \underbrace {\left[ {\begin{array}{*{20}{c}} 4\\ 5\\ 6 \end{array}} \right]}_{\color{red}{3} \times 1} = \color{red}{\text{NOT DEFINED}} $

The Product of a Row Vector and Matrix

When the number of elements in row vector is the same as the number of rows in the second matrix then this matrix multiplication can be performed.

$ \underbrace {\left[ {\begin{array}{*{20}{c}} \color{red}{1}&\color{red}{2}&\color{red}{3} \end{array}} \right]}_{1 \times \color{blue}{3}} \cdot \underbrace {\left[ {\begin{array}{*{20}{c}} \color{blue}{2}&\color{pink}{1}&\color{orange}{3}\\ \color{blue}{3}&\color{pink}{3}&\color{orange}{2}\\ \color{blue}{4}&\color{pink}{1}&\color{orange}{2} \end{array}} \right]}_{\color{blue}{3} \times 3} = \left[ {\begin{array}{*{20}{c}} {\color{red}{1} \cdot \color{blue}{2} + \color{red}{2} \cdot \color{blue}{3} + \color{red}{3} \cdot \color{blue}{4}}\\ {\color{red}{1} \cdot \color{pink}{1} + \color{red}{2} \cdot \color{pink}{3} + \color{red}{3} \cdot \color{pink}{1}}\\ {\color{red}{1} \cdot \color{orange}{3} + \color{red}{2} \cdot \color{orange}{2} + \color{red}{3} \cdot \color{orange}{2}} \end{array}} \right] = \underbrace {\left[ {\begin{array}{*{20}{c}} {20}\\ {10}\\ {13} \end{array}} \right]}_{1 \times 3} $

If the number of elements in row vector is NOT the same as the number of rows in the second matrix then their product is not defined .

$ \underbrace {\left[ {\begin{array}{*{20}{c}} \color{red}{1}&\color{red}{2}&\color{red}{3} \end{array}} \right]}_{1 \times \color{red}{3}} \cdot \underbrace {\left[ {\begin{array}{*{20}{l}} 1&3&5\\ 2&4&6 \end{array}} \right]}_{\color{red}{2} \times 3} = \color{red}{\text{NOT DEFINED}} $

Matrix Multiplication - General Case

When the number of columns of the first matrix is the same as the number of rows in the second matrix then matrix multiplication can be performed.

Multiplying a $2 \times 3$ matrix by a $3 \times 2$ matrix is possible, and it gives a $2 \times 2$ matrix as the result.

$ \underbrace {\left[ {\begin{array}{*{20}{l}} ?&?&?\\ ?&?&? \end{array}} \right]}_{2 \times \color{blue}{3}} \cdot \underbrace {\left[ {\begin{array}{*{20}{l}} ?&?\\ ?&?\\ ?&? \end{array}} \right]}_{\color{blue}{3} \times 2} = \underbrace {\left[ {\begin{array}{*{20}{c}} ?&?\\ ?&? \end{array}} \right]}_{2 \times 2} $

Multiplying a $2 \times 3$ matrix by a $2 \times 3$ matrix is not defined.

$ \underbrace {\left[ {\begin{array}{*{20}{l}} ?&?&?\\ ?&?&? \end{array}} \right]}_{2 \times \color{red}{3}} \cdot \underbrace {\left[ {\begin{array}{*{20}{l}} ?&?&?\\ ?&?&? \end{array}} \right]}_{\color{red}{2} \times 3} = \color{red}{\text{NOT DEFINED}} $

Here is an example of matrix multiplication for two concrete matrices

Example: Find the product $AB$ where $A$ and $B$ are matrices:

$ A = \left[ {\begin{array}{*{20}{l}} 1&3&5\\ 2&4&6 \end{array}} \right] \ \ \ \ B = \left[ {\begin{array}{*{20}{l}} 3&6\\ 1&4\\ 5&2 \end{array}} \right] $

The product $AB$ is defined since $A$ is a $2 \times 3$ matrix and $B$ is a $3 \times 2$ matrix. The answer is a $2 \times 2$ matrix. The multiplication is divided into 4 steps.

Multiply the 1st row of the first matrix and 1st column of the second matrix, element by element. The result goes in the position (1, 1)

$ \left[ {\begin{array}{*{20}{l}} \color{red}{1}&\color{red}{3}&\color{red}{5}\\ 2&4&6 \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{l}} \color{blue}{3}&6\\ \color{blue}{1}&4\\ \color{blue}{5}&2 \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {\color{red}{1} \cdot \color{blue}{3} + \color{red}{3} \cdot \color{blue}{1} + \color{red}{5} \cdot \color{blue}{5}}&?\\ ?&? \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {31}&?\\ ?&? \end{array}} \right] $

Now, multiply the 1st row of the first matrix and 2nd column of the second matrix. The result goes in the position (1, 2)

$ \left[ {\begin{array}{*{20}{l}} \color{red}{1}&\color{red}{3}&\color{red}{5}\\ 2&4&6 \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{l}} 3&\color{blue}{6}\\ 1&\color{blue}{4}\\ 5&\color{blue}{2} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} 31&{\color{red}{1} \cdot \color{blue}{6} + \color{red}{3} \cdot \color{blue}{4} + \color{red}{5} \cdot \color{blue}{2}}\\ ?&? \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {31}&{28}\\ ?&? \end{array}} \right] $

Next, multiply 2nd row of the first matrix and the 1st column of the second matrix. The result goes in the position (2, 1)

$ \left[ {\begin{array}{*{20}{l}} 1&3&5\\ \color{red}{2}&\color{red}{4}&\color{red}{6} \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{l}} \color{blue}{3}&6\\ \color{blue}{1}&4\\ \color{blue}{5}&2 \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} 31&28\\ {\color{red}{2} \cdot \color{blue}{3} + \color{red}{4} \cdot \color{blue}{1} + \color{red}{6} \cdot \color{blue}{5}}&? \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {31}&{28}\\ {40}&? \end{array}} \right] $

Finally, multiply 2nd row of the first matrix and the 2st column of the second matrix. The result goes in the position (2, 2)

$ \left[ {\begin{array}{*{20}{l}} 1&3&5\\ \color{red}{2}&\color{red}{4}&\color{red}{6} \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{l}} \color{blue}{3}&6\\ \color{blue}{1}&4\\ \color{blue}{5}&2 \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} 31&28\\ 40&{\color{red}{2} \cdot \color{blue}{6} + \color{red}{4} \cdot \color{blue}{4} + \color{red}{6} \cdot \color{blue}{2}} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {31}&{28}\\ {40}&{40} \end{array}} \right] $

So, the result is:

$ \left[ {\begin{array}{*{20}{l}} 1&3&5\\ 2&4&6 \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{l}} 3&6\\ 1&4\\ 5&2 \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {31}&{28}\\ {40}&{40} \end{array}} \right] $

Example 2: Find the product AB where A and B are matrices given by:

$ A = \left[ {\begin{array}{*{20}{c}} 2&1\\ 3&5 \end{array}} \right] \ \ \ \ \ B = \left[ {\begin{array}{*{20}{c}} { - 2}&3\\ 4&{ - 1} \end{array}} \right] $

$ A \cdot B = \left[ {\begin{array}{*{20}{c}} 2&1\\ 3&5 \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{c}} { - 2}&3\\ 4&{ - 1} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} {2 \cdot ( - 2) + 1 \cdot 4}&{2 \cdot 3 + 1 \cdot ( - 1)}\\ {3 \cdot ( - 2) + 5 \cdot 4}&{3 \cdot 3 + 5 \cdot ( - 1)} \end{array}} \right] = \left[ {\begin{array}{*{20}{c}} 0&5\\ {14}&4 \end{array}} \right] $

  • Roots and Radicals Simplify Expression Adding and Subtracting Multiplying and Dividing
  • Complex Numbers Arithmetic Polar representation
  • Polynomials Multiplying Polynomials Division of Polynomials Zeros of Polynomials
  • Rational Expressions Simplifying Multiplying and Dividing Adding and Subtracting
  • Solving Equations Linear Equations Absolute Value Equations Quadratic Equation Equations with Radicals
  • Systems of Equations Substitution Method Elimination Method Row Reduction Cramers Rule Inverse Matrix Method
  • Exponential Functions Introduction Exponential Equations Logarithmic Functions
  • Trigonometry Trigonometric Formulas Trigonometric Equations Law of Cosines
  • Progressions Arithmetic Progressions Geometric Progressions
  • Differentiation Common formulas Product and Quotient Rule Chain Rule
  • Limits Properties of Limits Rational Function Irrational Functions Trigonometric Functions L'Hospital's Rule
  • Integrals Integration Formulas Exercises
  • Integral techniques Substitution Integration by Parts Integrals with Trig. Functions Trigonometric Substitutions
  • Integral Applications Area Volume Arc Length

Analytic geometry

  • Analytic Geometry 2D Basic Concepts Lines Parallel and Perpendicular Lines Polar Coordinates
  • Conic Sections Circle Ellipse Hyperbola
  • Analytic Geometry 3D Line in 3D Planes
  • Matrices Definitions Addition and Multiplication Gauss-Jordan elimination
  • Determinants Introduction to Determinants Applications of Determinants
  • Vectors Basic Operations Dot Product Cross Product

Random Quote

Every good mathematician is at least half a philosopher, and every good philosopher is at least half a mathematician.

Friedrich Ludwig Gottlob Frege

The essence of mathematics is not to make simple things complicated, but to make complicated things simple.

Welcome to MathPortal. This website's owner is mathematician Miloš Petrović. I designed this website and wrote all the calculators, lessons, and formulas .

If you want to contact me, probably have some questions, write me using the contact form or email me on [email protected]

Email (optional)

Matrix Multiplication Calculator

Matrix Multiplication Calculator

Enter rows and columns.

Here you can use Matrix Multiplication Calculator to calculate the complex matrix numbers online for free. A matrix is an array of numbers organized in rows and columns. Multiplying matrices is both challenging and rewarding. This matrix multiplication calculator can perform all matrix operations, such as adding, subtracting, multiplying, dividing, finding the determinant rank and raising to power as well as matrix vector multiplication. It even supports vector matrix multiplication. Multiplying two matrices together produces a new matrix called C. The dot product of elements in both matrices.

Using a Matrix Multiplication Calculator

Multiplying a matrix by any number results in another matrix with equal rows and columns. This process is known as scalar multiplication and forms the core operation of matrix algebra; used extensively across disciplines like mathematical statistics, physics, economics and engineering.

Matrix multiplication is an integral component of linear algebra, the study of linear maps represented by matrices. Additionally, matrix multiplication plays an integral part in computer graphics as it calculates an approximate list of points representing what an object would look like when zoomed in or out or rotated or otherwise altered. Matrix multiplication can be completed quickly since its calculations take place simultaneously across an entire matrix rather than independently for every point that needs changing.

To multiply a matrix by a number, simply enter it in the matrix multiplication calculator and press “Multiply”. The calculator will quickly multiply all of the numbers within a matrix by entering that number; you must use numbers, not variable (such as letters).

Matrix Calculator

Use this calculator to understand how to multiply a matrix by a vector. A scalar quantity, like speed, volume or mass is completely described by its magnitude; on the other hand vectors have both direction and magnitude, making multiplying matrix by vector difficult to do without receiving an error message on your calculator.

To multiply a matrix and vector, enter your number into its top row of the first matrix and click’multiply.’ When done, highlight your second matrix and press the “Multiply” button – however this process may initially seem confusing for those unfamiliar with matrix math. Assuming the number is strictly numerical and not variable makes understanding much simpler.

Most computer programs operate using matrix multiplication to generate a list of points that describe. What an object would look like if you zoomed in or out, rotated it, or made any other change to it. Computer graphics play an integral role in how matrix multiplication works, providing us with insight into why matrix multiplication occurs so quickly. However, there is no universal algorithm for matrix multiplication; each system may necessitate different protocols or processes including sometimes performing the matrix multiplication in reverse. This process may add further confusion.

Multiplying Matrices Calculator

Multiplication is an essential math skill that children will need to acquire as they progress through school, serving as the basis for other mathematical operations such as addition and subtraction. Thanks to multiplication’s commutative property, its results don’t depend on which order the numbers are multiplied – for instance 3×5 = 17 while 20×3 are both equal (17). This also applies for fractions or decimals like 0.3+0.44 or 4-3 = 2.

Matrix multiplication does not always comply with the commutative property. This is because, to enable multiplication, both matrices must have equal numbers of rows and columns; otherwise it cannot take place. In practice this means if one matrix contains rr rows and ss columns then its second counterpart must contain nr rows and tt columns for effective matrix multiplication to occur. If not then matrix multiplication cannot occur.

If you need to multiply two matrices together, our free online matrix multiplication calculator makes the task easy and will save time and effort with its intuitive user-friendly design. Simply input each matrix’s elements, click Calculate Matrix Product button and watch as this handy calculator calculates its product for you! You can even use our handy arrow keys, enter key, backspace key or delete keys to move between cells or use Ctrl+C and Ctrl+V copy/paste feature!

Matrix Multiplier

Matrix multiplication can be challenging to grasp, so it’s crucial that students practice by hand to gain an understanding of its process before using a calculator or any other assistance. This is particularly relevant when conducting written multiplications such as in a written test or assessment. Due to possible mathematical errors when performing matrix multiplication calculations manually on paper. It is especially vital that practice by hand takes place prior to any attempt with calculators or similar devices.

An effective way to practice matrix multiplication is through Cuemath, an online tool which uses visual representations to teach multiplication. Users can then create custom worksheets. This resource is ideal for students of all ages, as it helps develop both their times table knowledge and multiplication abilities.

This interactive tool can be used in class or as homework assignment and offers different approaches for students to complete the task, such as using grids or tables. Furthermore, this resource comes in multiple languages – making it accessible for students from around the globe! A commutative multiplication activity sheet is included to review this important math rule perfect for teachers looking for fun ways to teach their pupils.

Multiplication of Matrices Worksheets

How to Multiply Matrices - A matrix is a method of writing numbers, expressions, symbols, or a variety of other elements in square or rectangular arrays. These arrays consist of various rows and columns. While writing the structure of a matrix, it is important to write the number of rows first and then the number of columns. The standard format of writing the construct of a matrix is [Rows x Columns]. Usually, we deal with 2 by 2 or 3 by 3 matrices. 2 by 2 means 2 row and 2 columns. Similarly, 3 by 3 means 3 rows and 3 columns. Matrices can also be multiplied or divided by each other. While multiplying two matrices, the first thing that must be kept in mind is the number of elements in rows and columns must be equal. Two matrices can be multiplied with each other only if the number of elements in the rows of the first matrice is equal to the number of elements in the columns of the second. The multiplication is carried out between two matrices in a way that the elements of the first row of the first matrix get multiplied by the elements of the first column of the second matrices. Then the first row by the second column, then third until the last column approaches. The same process is repeated for all the rows to come.

Basic Lesson

Guides students through determining the product of matrices. Two matrices A and B are conformable for the product AB if the number of columns in A (pre-multiplier) is same as the number of rows in B (post-multiplier).

Intermediate Lesson

Demonstrates a step-by-step method for conforming a product of matrices. We show you an example of where matrix multiplication is not possible because the number of columns in the first matrix is not equal to the number of rows in the second matrix.

Independent Practice 1

A really great activity for allowing students to understand the concept of Multiplication of Matrices. Find the product. If the product is not defined, state the reason.

Independent Practice 2

Students find the Multiplication of Matrices in assorted problems. The answers can be found below.

Homework Worksheet

SStudents are provided with problems to achieve the concepts of Multiplication of Matrices.

This tests the students ability to evaluate Multiplication of Matrices.

Homework and Quiz Answer Key

Answers for the homework and quiz.

Answers for the lesson and practice sheets.

What "puzzle" appeared on the "Father of Algebra's" tombstone?

Answer: The puzzle told us the length of Diophantus' life (84 years). Let the length of his life be called x. 1/6 x + 1/12 x + 1/7 x + 5 + 1/2 x + 4 = x

logo

Have an account?

Suggestions for you See more

Quiz image

8th -  10th  

Matrix operations and multiplication, 8th -  11th  , 10th -  12th  , prepositions, determinants and inverses of matrices, 11th -  12th  , multiplying matrices, 9th -  11th  .

pencil-icon

MULTIPLYING MATRICES

9th - 12th grade, mathematics.

User image

19 questions

Player avatar

Introducing new   Paper mode

No student devices needed.   Know more

  • 2. Multiple Choice Edit 30 seconds 1 pt You can multiply a 2X3 matrix by which matrix? 2X2 2X12 3X12 2X3
  • 4. Multiple Choice Edit 1 minute 1 pt How many columns are in a 5 x 4 matrix? 5 4 20 9
  • 8. Multiple Choice Edit 15 minutes 1 pt You can multiply a 6X2 matrix by which matrix? 6X2 2X12 3X12 6x3

What is the name of each entry of a matrix?

  • 17. Multiple Choice Edit 30 seconds 1 pt Given matrices A & B:  A is a (4x33) matrix B is a (33x1) matrix  What are the dimensions of the product of A times B ? 4x1 4x33 33x1 Matrix does not exist
  • 19. Multiple Choice Edit 15 minutes 1 pt matrix A = 2 x 7, matrix B = 7 x 2  Determine which of the following operations exist.   A + B AB BA AB t

Explore all questions with a free account

Google Logo

Continue with email

Continue with phone

You current level is  Student

Getting Started

  • Coding Interviews Patterns
  • How to Study
  • Math Basics
  • Runtime to Algo Cheat Sheet
  • Keyword to Algo Cheat Sheet
  • Basic Data Structures and Algorithms
  • Stack Intro
  • Queue Intro
  • Hashmap Intro
  • Python Basic Data Structures
  • Java Basic Data Structures
  • JavaScript Basic Data Structures
  • C++ Basic Data Structures
  • Intro to Sorting
  • Advanced Sorting Algorithms - Merge Sort | Quick Sort
  • Sorting Summary
  • Built-in Sort with Custom Comparator
  • Simulation Coding Problems: Introduction and Strategies

Binary Search

  • Vanilla Binary Search
  • First True in a Sorted Boolean Array
  • Monotonic Function
  • First Element Not Smaller Than Target
  • First Occurrence
  • Square Root Estimation
  • Minimum in Rotated Sorted Array
  • Peak of Mountain Array
  • Binary Search Speedrun

Depth First Search

  • Recursion Review
  • Everything About Trees
  • DFS Fundamentals
  • Introduction
  • Max Depth of A Tree
  • Visible Tree Node
  • Balanced Binary Tree
  • Invert Binary Tree
  • Binary Search Tree Intro
  • Valid Binary Search Tree
  • Insert Into BST
  • Lowest Common Ancestor of a Binary Search Tree
  • Serializing and Deserializing Binary Tree
  • Lowest Common Ancestor

Backtracking

  • DFS with States
  • Backtracking 1
  • Generate All Phone Number Combinations
  • Backtracking 1 - Pruning
  • Partition a String Into Palindromes
  • Backtracking 1 - Additional States
  • Generate All Valid Parentheses
  • General All Permutations
  • Backtracking 2 - Aggregation
  • Memoization
  • Num Ways to Decode a Message
  • Min Coins to Make Change
  • Deduplication
  • Combination Sum
  • Backtracking Speedrun

Breadth First Search

  • BFS Fundamentals
  • Binary Tree Level Order Traversal
  • Binary Tree ZigZag Level Order Traversal
  • Binary Tree Right Side View
  • Binary Tree Min Depth
  • Graph Fundamentals
  • BFS on Graphs
  • DFS on Graph
  • Shortest Path
  • Matrix as Graph
  • Number of Islands
  • Knight Minimum Moves
  • Walls and Gates / Zombie in Matrix
  • Open the Lock
  • Word Ladder
  • Sliding Puzzle
  • Topological Sort Introduction
  • Task Scheduling
  • Reconstructing Sequence
  • Task Scheduling 2
  • Alien Dictionary
  • Course Schedule
  • Dijkstra's Algorithm | Shortest Path in a Weighted Graph
  • Introduction to Minimum Spanning Tree
  • Minimum Spanning Tree | Forests
  • Graph Speedrun - Part 1
  • Graph Speedrun - Part 2

Two Pointers

  • Two Pointers Introduction
  • Remove Duplicates
  • Middle of a Linked List
  • Two Sum Sorted
  • Valid Palindrome
  • Subarray Sum - Fixed
  • Find All Anagrams in a String
  • Sliding Window - Longest
  • Longest Substring without Repeating Characters
  • Sliding Window - Shortest
  • Least Consecutive Cards to Match
  • Linked List Cycle
  • Minimum Window Substring
  • Teleporter Arrays
  • Two Pointers Speedrun

Priority Queue / Heap

  • Heap Fundamentals
  • K Closest points
  • Merge K Sorted Lists
  • Kth Largest Element in an Array
  • Kth Smallest Element in a Sorted Matrix
  • Reorganize String
  • Ugly Number
  • Median of Data Stream

Dynamic Programming

  • Dynamic Programming Introduction and Patterns
  • Grid DP Introduction
  • Number of Robot Paths
  • Minimal Path Sum
  • Maximal Square
  • Longest Increasing Subsequence
  • Largest Divisible Subset
  • Perfect Squares
  • Divisor Game
  • Interval DP Introduction
  • Festival Game
  • Dual-Sequence DP Introduction
  • Longest Common Subsequence
  • Edit Distance
  • Delete String
  • Knapsack DP Introduction
  • Knapsack, Weight-Only
  • Partition to Two Equal Sum Subsets
  • 0-1 Knapsack
  • Coin Change
  • Coin Change II
  • Bitmask Introduction
  • Min Cost to Visit Every Node
  • DP Practice List

Adv. Data Structures

  • DSU/Union Find Fundamentals
  • DSU Introductory Problem
  • Size of Connect Components
  • Merge User Accounts
  • Number of Connected Components
  • Umbristan | Reverse Union Find
  • Trie Introduction
  • Autocomplete
  • Prefix Count
  • Segment Tree

Miscellaneous

  • Merge Intervals
  • Insert Interval
  • Meeting Room
  • Monotonic Stack/Queue Intro
  • Sliding Window Maximum
  • Daily Temperatures
  • Next Greater Element II
  • Divide and Conquer Intro
  • The Skyline Problem
  • Count of Smaller Numbers After Self
  • Line-Sweep Introduction
  • Closest BST Values II
  • Greedy Introduction
  • Gas Station
  • Prime Sieve Introduction
  • Sparse Matrix Multiplication
  • Playing Cards
  • Parking Spots
  • Public Library
  • Call Center
  • Vending Machine

System Design

  • Load Balancing
  • Partition and Sharding
  • URL Shortener | TinyURL | System Design Interview Question
  • Web Crawler

Company-specific OAs

  • Amazon Online Assessment Questions 2021 (OA)
  • Robot in Circle
  • Number Game
  • Find All Combination of Numbers that Sum to a Target
  • Fill The Truck
  • Slowest Key
  • Five Star Sellers
  • Number of Ways to Split Into Primes
  • Storage Optimization
  • Minimum Difficulty of a Job Schedule
  • Autoscale Policy, Utilization Check
  • Optimal Utilization
  • Merge Two Sorted Lists
  • Two Sum - Unique Pairs
  • Shopping Patterns
  • Amazon Prime Air Delivery Route
  • Reorder Data in Log Files
  • Top K Frequently Mentioned Keywords
  • Microsoft Online Assessment Questions
  • Max Network Rank
  • Minimum Adj Swaps to Make Palindrome
  • Lexicographically Smallest String
  • Longest Substring Without 3 Contiguous Occurrences of Letter
  • Min Moves to Obtain String Without 3 Identical Consecutive Letters
  • String Without 3 Identical Consecutive Letters
  • Longest Semi-Alternating Substring
  • Min Steps to Make Piles Equal Height
  • Day of week that is K days later
  • Max Inserts to Obtain String Without 3 Consecutive 'a'
  • Concatenated String Length with unique Characters
  • Largest K such that both K and -K exist in array
  • Min Adj Swaps to Group Red Balls
  • Maximum Length of a Concatenated String with Unique Characters
  • Unique Integers That Sum Up To 0
  • Min Deletions To Obtain String in Right Format
  • Particle Velocity
  • Widest Path Without Trees
  • Fair Indexes
  • Partition array into N subsets with balanced sum
  • Google Online Assessment Questions 2021 (OA)
  • Compare Strings
  • Largest Subarray
  • Maximum Area Serving Cake
  • Minimum Number of Decreasing Subsequence Partitions
  • Pick Up Coupons
  • Rose Garden
  • Smallest Integer Satisfying the Rule
  • Fill 2D Array
  • Water Plants
  • Split Strings
  • Google Online Assessment 2021 (OA) - Rings on Rods
  • Google Online Assessment 2021 (OA) - Longest Palindrome
  • Twitter Online Assessment Questions 2021 (OA)
  • K-Different Pairs
  • Weird Faculty
  • Social Network
  • University Career Fair
  • Game Events
  • Activate Fountain
  • Final Discounted Price
  • Partition Array
  • Authentication Tokens
  • Parking Dilemma
  • Efficient Job Processing Service
  • Unique Twitter User ID Set

LeetCode Editorials

  • Minimum Swaps to Group All 1's Together
  • Bad Product
  • Beautiful Arrangement
  • Boats to Save People
  • Combination Sum II
  • Container With Most Water
  • Course Schedule II
  • Koko Eating Bananas
  • Evaluate Division
  • Find All Possible Recipes From Given Supplies
  • Is Graph Bipartite
  • Kth Missing Positive Number
  • Longest Substring with At Most Two Distinct Characters
  • Matchsticks to Square
  • Maximal Network Rank
  • Minesweeper
  • Minimum Size Subarray Sum
  • My Calendar I
  • Network Delay Time
  • Numbers With Same Consecutive Differences
  • Pacific Atlantic Water Flow
  • Path Sum II
  • Permutations II
  • Plates Between Candles
  • Reconstruct Itinerary
  • Redundant Connection
  • Regions Cut By Slashes
  • Restore IP Addresses
  • Rotting Oranges
  • Satisfiability of Equality Equations
  • Find First and Last Position of Element in Sorted Array
  • Shortest Path in Binary Matrix
  • Single Element in a Sorted Array
  • Snapshot Array
  • Time Based key-Value Store
  • Word Break II
  • 2. Add Two Numbers
  • 3. Longest Substring Without Repeating Characters
  • 4. Median of Two Sorted Arrays
  • 5. Longest Palindromic Substring
  • 6. Zigzag Conversion
  • 7. Reverse Integer
  • 8. String to Integer (atoi)
  • 9. Palindrome Number
  • 10. Regular Expression Matching
  • 11. Container With Most Water
  • 12. Integer to Roman
  • 13. Roman to Integer
  • 14. Longest Common Prefix
  • 16. 3Sum Closest
  • 17. Letter Combinations of a Phone Number
  • 19. Remove Nth Node From End of List
  • 20. Valid Parentheses
  • 21. Merge Two Sorted Lists
  • 22. Generate Parentheses
  • 23. Merge k Sorted Lists
  • 24. Swap Nodes in Pairs
  • 25. Reverse Nodes in k-Group
  • 26. Remove Duplicates from Sorted Array
  • 27. Remove Element
  • 28. Find the Index of the First Occurrence in a String
  • 29. Divide Two Integers
  • 30. Substring with Concatenation of All Words
  • 31. Next Permutation
  • 32. Longest Valid Parentheses
  • 33. Search in Rotated Sorted Array
  • 34. Find First and Last Position of Element in Sorted Array
  • 35. Search Insert Position
  • 36. Valid Sudoku
  • 37. Sudoku Solver
  • 38. Count and Say
  • 39. Combination Sum
  • 40. Combination Sum II
  • 41. First Missing Positive
  • 42. Trapping Rain Water
  • 43. Multiply Strings
  • 44. Wildcard Matching
  • 45. Jump Game II
  • 46. Permutations
  • 47. Permutations II
  • 48. Rotate Image
  • 49. Group Anagrams
  • 50. Pow(x, n)
  • 51. N-Queens
  • 52. N-Queens II
  • 53. Maximum Subarray
  • 54. Spiral Matrix
  • 55. Jump Game
  • 56. Merge Intervals
  • 57. Insert Interval
  • 58. Length of Last Word
  • 59. Spiral Matrix II
  • 60. Permutation Sequence
  • 61. Rotate List
  • 62. Unique Paths
  • 63. Unique Paths II
  • 64. Minimum Path Sum
  • 65. Valid Number
  • 66. Plus One
  • 67. Add Binary
  • 68. Text Justification
  • 69. Sqrt(x)
  • 70. Climbing Stairs
  • 71. Simplify Path
  • 72. Edit Distance
  • 73. Set Matrix Zeroes
  • 74. Search a 2D Matrix
  • 75. Sort Colors
  • 76. Minimum Window Substring
  • 77. Combinations
  • 78. Subsets
  • 79. Word Search
  • 80. Remove Duplicates from Sorted Array II
  • 81. Search in Rotated Sorted Array II
  • 82. Remove Duplicates from Sorted List II
  • 83. Remove Duplicates from Sorted List
  • 84. Largest Rectangle in Histogram
  • 85. Maximal Rectangle
  • 86. Partition List
  • 87. Scramble String
  • 88. Merge Sorted Array
  • 89. Gray Code
  • 90. Subsets II
  • 91. Decode Ways
  • 92. Reverse Linked List II
  • 93. Restore IP Addresses
  • 94. Binary Tree Inorder Traversal
  • 95. Unique Binary Search Trees II
  • 96. Unique Binary Search Trees
  • 97. Interleaving String
  • 98. Validate Binary Search Tree
  • 99. Recover Binary Search Tree
  • 100. Same Tree
  • 101. Symmetric Tree
  • 102. Binary Tree Level Order Traversal
  • 103. Binary Tree Zigzag Level Order Traversal
  • 104. Maximum Depth of Binary Tree
  • 105. Construct Binary Tree from Preorder and Inorder Traversal
  • 106. Construct Binary Tree from Inorder and Postorder Traversal
  • 107. Binary Tree Level Order Traversal II
  • 108. Convert Sorted Array to Binary Search Tree
  • 109. Convert Sorted List to Binary Search Tree
  • 110. Balanced Binary Tree
  • 111. Minimum Depth of Binary Tree
  • 112. Path Sum
  • 113. Path Sum II
  • 114. Flatten Binary Tree to Linked List
  • 115. Distinct Subsequences
  • 116. Populating Next Right Pointers in Each Node
  • 117. Populating Next Right Pointers in Each Node II
  • 118. Pascal's Triangle
  • 119. Pascal's Triangle II
  • 120. Triangle
  • 121. Best Time to Buy and Sell Stock
  • 122. Best Time to Buy and Sell Stock II
  • 123. Best Time to Buy and Sell Stock III
  • 124. Binary Tree Maximum Path Sum
  • 125. Valid Palindrome
  • 126. Word Ladder II
  • 127. Word Ladder
  • 128. Longest Consecutive Sequence
  • 129. Sum Root to Leaf Numbers
  • 130. Surrounded Regions
  • 131. Palindrome Partitioning
  • 132. Palindrome Partitioning II
  • 133. Clone Graph
  • 134. Gas Station
  • 136. Single Number
  • 137. Single Number II
  • 138. Copy List with Random Pointer
  • 139. Word Break
  • 140. Word Break II
  • 141. Linked List Cycle
  • 142. Linked List Cycle II
  • 143. Reorder List
  • 144. Binary Tree Preorder Traversal
  • 145. Binary Tree Postorder Traversal
  • 146. LRU Cache
  • 147. Insertion Sort List
  • 148. Sort List
  • 149. Max Points on a Line
  • 150. Evaluate Reverse Polish Notation
  • 151. Reverse Words in a String
  • 152. Maximum Product Subarray
  • 153. Find Minimum in Rotated Sorted Array
  • 154. Find Minimum in Rotated Sorted Array II
  • 155. Min Stack
  • 156. Binary Tree Upside Down
  • 157. Read N Characters Given Read4
  • 158. Read N Characters Given read4 II - Call Multiple Times
  • 159. Longest Substring with At Most Two Distinct Characters
  • 160. Intersection of Two Linked Lists
  • 161. One Edit Distance
  • 162. Find Peak Element
  • 163. Missing Ranges
  • 164. Maximum Gap
  • 165. Compare Version Numbers
  • 166. Fraction to Recurring Decimal
  • 167. Two Sum II - Input Array Is Sorted
  • 168. Excel Sheet Column Title
  • 169. Majority Element
  • 170. Two Sum III - Data structure design
  • 171. Excel Sheet Column Number
  • 172. Factorial Trailing Zeroes
  • 173. Binary Search Tree Iterator
  • 174. Dungeon Game
  • 179. Largest Number
  • 186. Reverse Words in a String II
  • 187. Repeated DNA Sequences
  • 188. Best Time to Buy and Sell Stock IV
  • 189. Rotate Array
  • 190. Reverse Bits
  • 191. Number of 1 Bits
  • 198. House Robber
  • 199. Binary Tree Right Side View
  • 200. Number of Islands
  • 201. Bitwise AND of Numbers Range
  • 202. Happy Number
  • 203. Remove Linked List Elements
  • 204. Count Primes
  • 205. Isomorphic Strings
  • 206. Reverse Linked List
  • 207. Course Schedule
  • 208. Implement Trie (Prefix Tree)
  • 209. Minimum Size Subarray Sum
  • 210. Course Schedule II
  • 211. Design Add and Search Words Data Structure
  • 212. Word Search II
  • 213. House Robber II
  • 214. Shortest Palindrome
  • 215. Kth Largest Element in an Array
  • 216. Combination Sum III
  • 217. Contains Duplicate
  • 218. The Skyline Problem
  • 219. Contains Duplicate II
  • 220. Contains Duplicate III
  • 221. Maximal Square
  • 222. Count Complete Tree Nodes
  • 223. Rectangle Area
  • 224. Basic Calculator
  • 225. Implement Stack using Queues
  • 226. Invert Binary Tree
  • 227. Basic Calculator II
  • 228. Summary Ranges
  • 229. Majority Element II
  • 230. Kth Smallest Element in a BST
  • 231. Power of Two
  • 232. Implement Queue using Stacks
  • 233. Number of Digit One
  • 234. Palindrome Linked List
  • 235. Lowest Common Ancestor of a Binary Search Tree
  • 236. Lowest Common Ancestor of a Binary Tree
  • 237. Delete Node in a Linked List
  • 238. Product of Array Except Self
  • 239. Sliding Window Maximum
  • 240. Search a 2D Matrix II
  • 241. Different Ways to Add Parentheses
  • 242. Valid Anagram
  • 243. Shortest Word Distance
  • 244. Shortest Word Distance II
  • 245. Shortest Word Distance III
  • 246. Strobogrammatic Number
  • 247. Strobogrammatic Number II
  • 248. Strobogrammatic Number III
  • 249. Group Shifted Strings
  • 250. Count Univalue Subtrees
  • 251. Flatten 2D Vector
  • 252. Meeting Rooms
  • 253. Meeting Rooms II
  • 254. Factor Combinations
  • 255. Verify Preorder Sequence in Binary Search Tree
  • 256. Paint House
  • 257. Binary Tree Paths
  • 258. Add Digits
  • 259. 3Sum Smaller
  • 260. Single Number III
  • 261. Graph Valid Tree
  • 263. Ugly Number
  • 264. Ugly Number II
  • 265. Paint House II
  • 266. Palindrome Permutation
  • 267. Palindrome Permutation II
  • 268. Missing Number
  • 269. Alien Dictionary
  • 270. Closest Binary Search Tree Value
  • 271. Encode and Decode Strings
  • 272. Closest Binary Search Tree Value II
  • 273. Integer to English Words
  • 274. H-Index
  • 275. H-Index II
  • 276. Paint Fence
  • 277. Find the Celebrity
  • 278. First Bad Version
  • 279. Perfect Squares
  • 280. Wiggle Sort
  • 281. Zigzag Iterator
  • 282. Expression Add Operators
  • 283. Move Zeroes
  • 284. Peeking Iterator
  • 285. Inorder Successor in BST
  • 286. Walls and Gates
  • 287. Find the Duplicate Number
  • 288. Unique Word Abbreviation
  • 289. Game of Life
  • 290. Word Pattern
  • 291. Word Pattern II
  • 292. Nim Game
  • 293. Flip Game
  • 294. Flip Game II
  • 295. Find Median from Data Stream
  • 296. Best Meeting Point
  • 297. Serialize and Deserialize Binary Tree
  • 298. Binary Tree Longest Consecutive Sequence
  • 299. Bulls and Cows
  • 300. Longest Increasing Subsequence
  • 301. Remove Invalid Parentheses
  • 302. Smallest Rectangle Enclosing Black Pixels
  • 303. Range Sum Query - Immutable
  • 304. Range Sum Query 2D - Immutable
  • 305. Number of Islands II
  • 306. Additive Number
  • 307. Range Sum Query - Mutable
  • 308. Range Sum Query 2D - Mutable
  • 309. Best Time to Buy and Sell Stock with Cooldown
  • 310. Minimum Height Trees

311. Sparse Matrix Multiplication

  • 312. Burst Balloons
  • 313. Super Ugly Number
  • 314. Binary Tree Vertical Order Traversal
  • 315. Count of Smaller Numbers After Self
  • 316. Remove Duplicate Letters
  • 317. Shortest Distance from All Buildings
  • 318. Maximum Product of Word Lengths
  • 319. Bulb Switcher
  • 320. Generalized Abbreviation
  • 321. Create Maximum Number
  • 322. Coin Change
  • 323. Number of Connected Components in an Undirected Graph
  • 324. Wiggle Sort II
  • 325. Maximum Size Subarray Sum Equals k
  • 326. Power of Three
  • 327. Count of Range Sum
  • 328. Odd Even Linked List
  • 329. Longest Increasing Path in a Matrix
  • 330. Patching Array
  • 331. Verify Preorder Serialization of a Binary Tree
  • 332. Reconstruct Itinerary
  • 333. Largest BST Subtree
  • 334. Increasing Triplet Subsequence
  • 335. Self Crossing
  • 336. Palindrome Pairs
  • 337. House Robber III
  • 338. Counting Bits
  • 339. Nested List Weight Sum
  • 340. Longest Substring with At Most K Distinct Characters
  • 341. Flatten Nested List Iterator
  • 342. Power of Four
  • 343. Integer Break
  • 344. Reverse String
  • 345. Reverse Vowels of a String
  • 346. Moving Average from Data Stream
  • 347. Top K Frequent Elements
  • 348. Design Tic-Tac-Toe
  • 349. Intersection of Two Arrays
  • 350. Intersection of Two Arrays II
  • 351. Android Unlock Patterns
  • 352. Data Stream as Disjoint Intervals
  • 353. Design Snake Game
  • 354. Russian Doll Envelopes
  • 355. Design Twitter
  • 356. Line Reflection
  • 357. Count Numbers with Unique Digits
  • 358. Rearrange String k Distance Apart
  • 359. Logger Rate Limiter
  • 360. Sort Transformed Array
  • 361. Bomb Enemy
  • 362. Design Hit Counter
  • 363. Max Sum of Rectangle No Larger Than K
  • 364. Nested List Weight Sum II
  • 365. Water and Jug Problem
  • 366. Find Leaves of Binary Tree
  • 367. Valid Perfect Square
  • 368. Largest Divisible Subset
  • 369. Plus One Linked List
  • 370. Range Addition
  • 371. Sum of Two Integers
  • 372. Super Pow
  • 373. Find K Pairs with Smallest Sums
  • 374. Guess Number Higher or Lower
  • 375. Guess Number Higher or Lower II
  • 376. Wiggle Subsequence
  • 377. Combination Sum IV
  • 378. Kth Smallest Element in a Sorted Matrix
  • 379. Design Phone Directory
  • 380. Insert Delete GetRandom O(1)
  • 381. Insert Delete GetRandom O(1) - Duplicates allowed
  • 382. Linked List Random Node
  • 383. Ransom Note
  • 384. Shuffle an Array
  • 385. Mini Parser
  • 386. Lexicographical Numbers
  • 387. First Unique Character in a String
  • 388. Longest Absolute File Path
  • 389. Find the Difference
  • 390. Elimination Game
  • 391. Perfect Rectangle
  • 392. Is Subsequence
  • 393. UTF-8 Validation
  • 394. Decode String
  • 395. Longest Substring with At Least K Repeating Characters
  • 396. Rotate Function
  • 397. Integer Replacement
  • 398. Random Pick Index
  • 399. Evaluate Division
  • 400. Nth Digit
  • 401. Binary Watch
  • 402. Remove K Digits
  • 403. Frog Jump
  • 404. Sum of Left Leaves
  • 405. Convert a Number to Hexadecimal
  • 406. Queue Reconstruction by Height
  • 407. Trapping Rain Water II
  • 408. Valid Word Abbreviation
  • 409. Longest Palindrome
  • 410. Split Array Largest Sum
  • 411. Minimum Unique Word Abbreviation
  • 412. Fizz Buzz
  • 413. Arithmetic Slices
  • 414. Third Maximum Number
  • 415. Add Strings
  • 416. Partition Equal Subset Sum
  • 417. Pacific Atlantic Water Flow
  • 418. Sentence Screen Fitting
  • 419. Battleships in a Board
  • 420. Strong Password Checker
  • 421. Maximum XOR of Two Numbers in an Array
  • 422. Valid Word Square
  • 423. Reconstruct Original Digits from English
  • 424. Longest Repeating Character Replacement
  • 425. Word Squares
  • 426. Convert Binary Search Tree to Sorted Doubly Linked List
  • 427. Construct Quad Tree
  • 428. Serialize and Deserialize N-ary Tree
  • 429. N-ary Tree Level Order Traversal
  • 430. Flatten a Multilevel Doubly Linked List
  • 431. Encode N-ary Tree to Binary Tree
  • 432. All O`one Data Structure
  • 433. Minimum Genetic Mutation
  • 434. Number of Segments in a String
  • 435. Non-overlapping Intervals
  • 436. Find Right Interval
  • 437. Path Sum III
  • 438. Find All Anagrams in a String
  • 439. Ternary Expression Parser
  • 440. K-th Smallest in Lexicographical Order
  • 441. Arranging Coins
  • 442. Find All Duplicates in an Array
  • 443. String Compression
  • 444. Sequence Reconstruction
  • 445. Add Two Numbers II
  • 446. Arithmetic Slices II - Subsequence
  • 447. Number of Boomerangs
  • 448. Find All Numbers Disappeared in an Array
  • 449. Serialize and Deserialize BST
  • 450. Delete Node in a BST
  • 451. Sort Characters By Frequency
  • 452. Minimum Number of Arrows to Burst Balloons
  • 453. Minimum Moves to Equal Array Elements
  • 454. 4Sum II
  • 455. Assign Cookies
  • 456. 132 Pattern
  • 457. Circular Array Loop
  • 458. Poor Pigs
  • 459. Repeated Substring Pattern
  • 460. LFU Cache
  • 461. Hamming Distance
  • 462. Minimum Moves to Equal Array Elements II
  • 463. Island Perimeter
  • 464. Can I Win
  • 465. Optimal Account Balancing
  • 466. Count The Repetitions
  • 467. Unique Substrings in Wraparound String
  • 468. Validate IP Address
  • 469. Convex Polygon
  • 470. Implement Rand10() Using Rand7()
  • 471. Encode String with Shortest Length
  • 472. Concatenated Words
  • 473. Matchsticks to Square
  • 474. Ones and Zeroes
  • 475. Heaters
  • 476. Number Complement
  • 477. Total Hamming Distance
  • 478. Generate Random Point in a Circle
  • 479. Largest Palindrome Product
  • 480. Sliding Window Median
  • 481. Magical String
  • 482. License Key Formatting
  • 483. Smallest Good Base
  • 484. Find Permutation
  • 485. Max Consecutive Ones
  • 486. Predict the Winner
  • 487. Max Consecutive Ones II
  • 488. Zuma Game
  • 489. Robot Room Cleaner
  • 490. The Maze
  • 491. Non-decreasing Subsequences
  • 492. Construct the Rectangle
  • 493. Reverse Pairs
  • 494. Target Sum
  • 495. Teemo Attacking
  • 496. Next Greater Element I
  • 497. Random Point in Non-overlapping Rectangles
  • 498. Diagonal Traverse
  • 499. The Maze III
  • 500. Keyboard Row
  • 501. Find Mode in Binary Search Tree
  • 503. Next Greater Element II
  • 504. Base 7
  • 505. The Maze II
  • 506. Relative Ranks
  • 507. Perfect Number
  • 508. Most Frequent Subtree Sum
  • 509. Fibonacci Number
  • 510. Inorder Successor in BST II
  • 513. Find Bottom Left Tree Value
  • 514. Freedom Trail
  • 515. Find Largest Value in Each Tree Row
  • 516. Longest Palindromic Subsequence
  • 517. Super Washing Machines
  • 518. Coin Change II
  • 519. Random Flip Matrix
  • 520. Detect Capital
  • 521. Longest Uncommon Subsequence I
  • 522. Longest Uncommon Subsequence II
  • 523. Continuous Subarray Sum
  • 524. Longest Word in Dictionary through Deleting
  • 525. Contiguous Array
  • 526. Beautiful Arrangement
  • 527. Word Abbreviation
  • 528. Random Pick with Weight
  • 529. Minesweeper
  • 530. Minimum Absolute Difference in BST
  • 531. Lonely Pixel I
  • 532. K-diff Pairs in an Array
  • 533. Lonely Pixel II
  • 535. Encode and Decode TinyURL
  • 536. Construct Binary Tree from String
  • 537. Complex Number Multiplication
  • 538. Convert BST to Greater Tree
  • 539. Minimum Time Difference
  • 540. Single Element in a Sorted Array
  • 541. Reverse String II
  • 542. 01 Matrix
  • 543. Diameter of Binary Tree
  • 544. Output Contest Matches
  • 545. Boundary of Binary Tree
  • 546. Remove Boxes
  • 547. Number of Provinces
  • 548. Split Array with Equal Sum
  • 549. Binary Tree Longest Consecutive Sequence II
  • 551. Student Attendance Record I
  • 552. Student Attendance Record II
  • 553. Optimal Division
  • 554. Brick Wall
  • 555. Split Concatenated Strings
  • 556. Next Greater Element III
  • 557. Reverse Words in a String III
  • 558. Logical OR of Two Binary Grids Represented as Quad-Trees
  • 559. Maximum Depth of N-ary Tree
  • 560. Subarray Sum Equals K
  • 561. Array Partition
  • 562. Longest Line of Consecutive One in Matrix
  • 563. Binary Tree Tilt
  • 564. Find the Closest Palindrome
  • 565. Array Nesting
  • 566. Reshape the Matrix
  • 567. Permutation in String
  • 568. Maximum Vacation Days
  • 572. Subtree of Another Tree
  • 573. Squirrel Simulation
  • 575. Distribute Candies
  • 576. Out of Boundary Paths
  • 581. Shortest Unsorted Continuous Subarray
  • 582. Kill Process
  • 583. Delete Operation for Two Strings
  • 587. Erect the Fence
  • 588. Design In-Memory File System
  • 589. N-ary Tree Preorder Traversal
  • 590. N-ary Tree Postorder Traversal
  • 591. Tag Validator
  • 592. Fraction Addition and Subtraction
  • 593. Valid Square
  • 594. Longest Harmonious Subsequence
  • 598. Range Addition II
  • 599. Minimum Index Sum of Two Lists
  • 600. Non-negative Integers without Consecutive Ones
  • 604. Design Compressed String Iterator
  • 605. Can Place Flowers
  • 606. Construct String from Binary Tree
  • 609. Find Duplicate File in System
  • 611. Valid Triangle Number
  • 616. Add Bold Tag in String
  • 617. Merge Two Binary Trees
  • 621. Task Scheduler
  • 622. Design Circular Queue
  • 623. Add One Row to Tree
  • 624. Maximum Distance in Arrays
  • 625. Minimum Factorization
  • 628. Maximum Product of Three Numbers
  • 629. K Inverse Pairs Array
  • 630. Course Schedule III
  • 631. Design Excel Sum Formula
  • 632. Smallest Range Covering Elements from K Lists
  • 633. Sum of Square Numbers
  • 634. Find the Derangement of An Array
  • 635. Design Log Storage System
  • 636. Exclusive Time of Functions
  • 637. Average of Levels in Binary Tree
  • 638. Shopping Offers
  • 639. Decode Ways II
  • 640. Solve the Equation
  • 641. Design Circular Deque
  • 642. Design Search Autocomplete System
  • 643. Maximum Average Subarray I
  • 644. Maximum Average Subarray II
  • 645. Set Mismatch
  • 646. Maximum Length of Pair Chain
  • 647. Palindromic Substrings
  • 648. Replace Words
  • 649. Dota2 Senate
  • 650. 2 Keys Keyboard
  • 651. 4 Keys Keyboard
  • 652. Find Duplicate Subtrees
  • 653. Two Sum IV - Input is a BST
  • 654. Maximum Binary Tree
  • 655. Print Binary Tree
  • 656. Coin Path
  • 657. Robot Return to Origin
  • 658. Find K Closest Elements
  • 659. Split Array into Consecutive Subsequences
  • 660. Remove 9
  • 661. Image Smoother
  • 662. Maximum Width of Binary Tree
  • 663. Equal Tree Partition
  • 664. Strange Printer
  • 665. Non-decreasing Array
  • 666. Path Sum IV
  • 667. Beautiful Arrangement II
  • 668. Kth Smallest Number in Multiplication Table
  • 669. Trim a Binary Search Tree
  • 670. Maximum Swap
  • 671. Second Minimum Node In a Binary Tree
  • 672. Bulb Switcher II
  • 673. Number of Longest Increasing Subsequence
  • 674. Longest Continuous Increasing Subsequence
  • 675. Cut Off Trees for Golf Event
  • 676. Implement Magic Dictionary
  • 677. Map Sum Pairs
  • 678. Valid Parenthesis String
  • 679. 24 Game
  • 680. Valid Palindrome II
  • 681. Next Closest Time
  • 682. Baseball Game
  • 683. K Empty Slots
  • 684. Redundant Connection
  • 685. Redundant Connection II
  • 686. Repeated String Match
  • 687. Longest Univalue Path
  • 688. Knight Probability in Chessboard
  • 689. Maximum Sum of 3 Non-Overlapping Subarrays
  • 690. Employee Importance
  • 691. Stickers to Spell Word
  • 692. Top K Frequent Words
  • 693. Binary Number with Alternating Bits
  • 694. Number of Distinct Islands
  • 695. Max Area of Island
  • 696. Count Binary Substrings
  • 697. Degree of an Array
  • 698. Partition to K Equal Sum Subsets
  • 699. Falling Squares
  • 700. Search in a Binary Search Tree
  • 701. Insert into a Binary Search Tree
  • 702. Search in a Sorted Array of Unknown Size
  • 703. Kth Largest Element in a Stream
  • 704. Binary Search
  • 705. Design HashSet
  • 706. Design HashMap
  • 707. Design Linked List
  • 708. Insert into a Sorted Circular Linked List
  • 709. To Lower Case
  • 710. Random Pick with Blacklist
  • 711. Number of Distinct Islands II
  • 712. Minimum ASCII Delete Sum for Two Strings
  • 713. Subarray Product Less Than K
  • 714. Best Time to Buy and Sell Stock with Transaction Fee
  • 715. Range Module
  • 716. Max Stack
  • 717. 1-bit and 2-bit Characters
  • 718. Maximum Length of Repeated Subarray
  • 719. Find K-th Smallest Pair Distance
  • 720. Longest Word in Dictionary
  • 721. Accounts Merge
  • 722. Remove Comments
  • 723. Candy Crush
  • 724. Find Pivot Index
  • 725. Split Linked List in Parts
  • 726. Number of Atoms
  • 727. Minimum Window Subsequence
  • 728. Self Dividing Numbers
  • 729. My Calendar I
  • 730. Count Different Palindromic Subsequences
  • 731. My Calendar II
  • 732. My Calendar III
  • 733. Flood Fill
  • 734. Sentence Similarity
  • 735. Asteroid Collision
  • 736. Parse Lisp Expression
  • 737. Sentence Similarity II
  • 738. Monotone Increasing Digits
  • 739. Daily Temperatures
  • 740. Delete and Earn
  • 741. Cherry Pickup
  • 742. Closest Leaf in a Binary Tree
  • 743. Network Delay Time
  • 744. Find Smallest Letter Greater Than Target
  • 745. Prefix and Suffix Search
  • 746. Min Cost Climbing Stairs
  • 747. Largest Number At Least Twice of Others
  • 748. Shortest Completing Word
  • 749. Contain Virus
  • 750. Number Of Corner Rectangles
  • 751. IP to CIDR
  • 752. Open the Lock
  • 753. Cracking the Safe
  • 754. Reach a Number
  • 755. Pour Water
  • 756. Pyramid Transition Matrix
  • 757. Set Intersection Size At Least Two
  • 758. Bold Words in String
  • 759. Employee Free Time
  • 760. Find Anagram Mappings
  • 761. Special Binary String
  • 762. Prime Number of Set Bits in Binary Representation
  • 763. Partition Labels
  • 764. Largest Plus Sign
  • 765. Couples Holding Hands
  • 766. Toeplitz Matrix
  • 767. Reorganize String
  • 768. Max Chunks To Make Sorted II
  • 769. Max Chunks To Make Sorted
  • 770. Basic Calculator IV
  • 771. Jewels and Stones
  • 772. Basic Calculator III
  • 773. Sliding Puzzle
  • 774. Minimize Max Distance to Gas Station
  • 775. Global and Local Inversions
  • 776. Split BST
  • 777. Swap Adjacent in LR String
  • 778. Swim in Rising Water
  • 779. K-th Symbol in Grammar
  • 780. Reaching Points
  • 781. Rabbits in Forest
  • 782. Transform to Chessboard
  • 783. Minimum Distance Between BST Nodes
  • 784. Letter Case Permutation
  • 785. Is Graph Bipartite
  • 786. K-th Smallest Prime Fraction
  • 787. Cheapest Flights Within K Stops
  • 788. Rotated Digits
  • 789. Escape The Ghosts
  • 790. Domino and Tromino Tiling
  • 791. Custom Sort String
  • 792. Number of Matching Subsequences
  • 793. Preimage Size of Factorial Zeroes Function
  • 794. Valid Tic-Tac-Toe State
  • 795. Number of Subarrays with Bounded Maximum
  • 796. Rotate String
  • 797. All Paths From Source to Target
  • 798. Smallest Rotation with Highest Score
  • 799. Champagne Tower
  • 800. Similar RGB Color
  • 801. Minimum Swaps To Make Sequences Increasing
  • 802. Find Eventual Safe States
  • 803. Bricks Falling When Hit
  • 804. Unique Morse Code Words
  • 805. Split Array With Same Average
  • 806. Number of Lines To Write String
  • 807. Max Increase to Keep City Skyline
  • 808. Soup Servings
  • 809. Expressive Words
  • 810. Chalkboard XOR Game
  • 811. Subdomain Visit Count
  • 812. Largest Triangle Area
  • 813. Largest Sum of Averages
  • 814. Binary Tree Pruning
  • 815. Bus Routes
  • 816. Ambiguous Coordinates
  • 817. Linked List Components
  • 818. Race Car
  • 819. Most Common Word
  • 820. Short Encoding of Words
  • 821. Shortest Distance to a Character
  • 822. Card Flipping Game
  • 823. Binary Trees With Factors
  • 824. Goat Latin
  • 825. Friends Of Appropriate Ages
  • 826. Most Profit Assigning Work
  • 827. Making A Large Island
  • 828. Count Unique Characters of All Substrings of a Given String
  • 829. Consecutive Numbers Sum
  • 830. Positions of Large Groups
  • 831. Masking Personal Information
  • 832. Flipping an Image
  • 833. Find And Replace in String
  • 834. Sum of Distances in Tree
  • 835. Image Overlap
  • 836. Rectangle Overlap
  • 837. New 21 Game
  • 838. Push Dominoes
  • 839. Similar String Groups
  • 840. Magic Squares In Grid
  • 841. Keys and Rooms
  • 842. Split Array into Fibonacci Sequence
  • 843. Guess the Word
  • 844. Backspace String Compare
  • 845. Longest Mountain in Array
  • 846. Hand of Straights
  • 847. Shortest Path Visiting All Nodes
  • 848. Shifting Letters
  • 849. Maximize Distance to Closest Person
  • 850. Rectangle Area II
  • 851. Loud and Rich
  • 852. Peak Index in a Mountain Array
  • 853. Car Fleet
  • 854. K-Similar Strings
  • 855. Exam Room
  • 856. Score of Parentheses
  • 857. Minimum Cost to Hire K Workers
  • 858. Mirror Reflection
  • 859. Buddy Strings
  • 860. Lemonade Change
  • 861. Score After Flipping Matrix
  • 862. Shortest Subarray with Sum at Least K
  • 863. All Nodes Distance K in Binary Tree
  • 864. Shortest Path to Get All Keys
  • 865. Smallest Subtree with all the Deepest Nodes
  • 866. Prime Palindrome
  • 867. Transpose Matrix
  • 868. Binary Gap
  • 869. Reordered Power of 2
  • 870. Advantage Shuffle
  • 871. Minimum Number of Refueling Stops
  • 872. Leaf-Similar Trees
  • 873. Length of Longest Fibonacci Subsequence
  • 874. Walking Robot Simulation
  • 875. Koko Eating Bananas
  • 876. Middle of the Linked List
  • 877. Stone Game
  • 878. Nth Magical Number
  • 879. Profitable Schemes
  • 880. Decoded String at Index
  • 881. Boats to Save People
  • 882. Reachable Nodes In Subdivided Graph
  • 883. Projection Area of 3D Shapes
  • 884. Uncommon Words from Two Sentences
  • 885. Spiral Matrix III
  • 886. Possible Bipartition
  • 887. Super Egg Drop
  • 888. Fair Candy Swap
  • 889. Construct Binary Tree from Preorder and Postorder Traversal
  • 890. Find and Replace Pattern
  • 891. Sum of Subsequence Widths
  • 892. Surface Area of 3D Shapes
  • 893. Groups of Special-Equivalent Strings
  • 894. All Possible Full Binary Trees
  • 895. Maximum Frequency Stack
  • 896. Monotonic Array
  • 897. Increasing Order Search Tree
  • 898. Bitwise ORs of Subarrays
  • 899. Orderly Queue
  • 900. RLE Iterator
  • 901. Online Stock Span
  • 902. Numbers At Most N Given Digit Set
  • 903. Valid Permutations for DI Sequence
  • 904. Fruit Into Baskets
  • 905. Sort Array By Parity
  • 906. Super Palindromes
  • 907. Sum of Subarray Minimums
  • 908. Smallest Range I
  • 909. Snakes and Ladders
  • 910. Smallest Range II
  • 911. Online Election
  • 912. Sort an Array
  • 913. Cat and Mouse
  • 914. X of a Kind in a Deck of Cards
  • 915. Partition Array into Disjoint Intervals
  • 916. Word Subsets
  • 917. Reverse Only Letters
  • 918. Maximum Sum Circular Subarray
  • 919. Complete Binary Tree Inserter
  • 920. Number of Music Playlists
  • 921. Minimum Add to Make Parentheses Valid
  • 922. Sort Array By Parity II
  • 923. 3Sum With Multiplicity
  • 924. Minimize Malware Spread
  • 925. Long Pressed Name
  • 926. Flip String to Monotone Increasing
  • 927. Three Equal Parts
  • 928. Minimize Malware Spread II
  • 929. Unique Email Addresses
  • 930. Binary Subarrays With Sum
  • 931. Minimum Falling Path Sum
  • 932. Beautiful Array
  • 933. Number of Recent Calls
  • 934. Shortest Bridge
  • 935. Knight Dialer
  • 936. Stamping The Sequence
  • 937. Reorder Data in Log Files
  • 938. Range Sum of BST
  • 939. Minimum Area Rectangle
  • 940. Distinct Subsequences II
  • 941. Valid Mountain Array
  • 942. DI String Match
  • 943. Find the Shortest Superstring
  • 944. Delete Columns to Make Sorted
  • 945. Minimum Increment to Make Array Unique
  • 946. Validate Stack Sequences
  • 947. Most Stones Removed with Same Row or Column
  • 948. Bag of Tokens
  • 949. Largest Time for Given Digits
  • 950. Reveal Cards In Increasing Order
  • 951. Flip Equivalent Binary Trees
  • 952. Largest Component Size by Common Factor
  • 953. Verifying an Alien Dictionary
  • 954. Array of Doubled Pairs
  • 955. Delete Columns to Make Sorted II
  • 956. Tallest Billboard
  • 957. Prison Cells After N Days
  • 958. Check Completeness of a Binary Tree
  • 959. Regions Cut By Slashes
  • 960. Delete Columns to Make Sorted III
  • 961. N-Repeated Element in Size 2N Array
  • 962. Maximum Width Ramp
  • 963. Minimum Area Rectangle II
  • 964. Least Operators to Express Number
  • 965. Univalued Binary Tree
  • 966. Vowel Spellchecker
  • 967. Numbers With Same Consecutive Differences
  • 968. Binary Tree Cameras
  • 969. Pancake Sorting
  • 970. Powerful Integers
  • 971. Flip Binary Tree To Match Preorder Traversal
  • 972. Equal Rational Numbers
  • 973. K Closest Points to Origin
  • 974. Subarray Sums Divisible by K
  • 975. Odd Even Jump
  • 976. Largest Perimeter Triangle
  • 977. Squares of a Sorted Array
  • 978. Longest Turbulent Subarray
  • 979. Distribute Coins in Binary Tree
  • 980. Unique Paths III
  • 981. Time Based Key-Value Store
  • 982. Triples with Bitwise AND Equal To Zero
  • 983. Minimum Cost For Tickets
  • 984. String Without AAA or BBB
  • 985. Sum of Even Numbers After Queries
  • 986. Interval List Intersections
  • 987. Vertical Order Traversal of a Binary Tree
  • 988. Smallest String Starting From Leaf
  • 989. Add to Array-Form of Integer
  • 990. Satisfiability of Equality Equations
  • 991. Broken Calculator
  • 992. Subarrays with K Different Integers
  • 993. Cousins in Binary Tree
  • 994. Rotting Oranges
  • 995. Minimum Number of K Consecutive Bit Flips
  • 996. Number of Squareful Arrays
  • 997. Find the Town Judge
  • 998. Maximum Binary Tree II
  • 999. Available Captures for Rook
  • 1000. Minimum Cost to Merge Stones
  • 1001. Grid Illumination
  • 1002. Find Common Characters
  • 1003. Check If Word Is Valid After Substitutions
  • 1004. Max Consecutive Ones III
  • 1005. Maximize Sum Of Array After K Negations
  • 1006. Clumsy Factorial
  • 1007. Minimum Domino Rotations For Equal Row
  • 1008. Construct Binary Search Tree from Preorder Traversal
  • 1009. Complement of Base 10 Integer
  • 1010. Pairs of Songs With Total Durations Divisible by 60
  • 1011. Capacity To Ship Packages Within D Days
  • 1012. Numbers With Repeated Digits
  • 1013. Partition Array Into Three Parts With Equal Sum
  • 1014. Best Sightseeing Pair
  • 1015. Smallest Integer Divisible by K
  • 1016. Binary String With Substrings Representing 1 To N
  • 1017. Convert to Base -2
  • 1018. Binary Prefix Divisible By 5
  • 1019. Next Greater Node In Linked List
  • 1020. Number of Enclaves
  • 1021. Remove Outermost Parentheses
  • 1022. Sum of Root To Leaf Binary Numbers
  • 1023. Camelcase Matching
  • 1024. Video Stitching
  • 1025. Divisor Game
  • 1026. Maximum Difference Between Node and Ancestor
  • 1027. Longest Arithmetic Subsequence
  • 1028. Recover a Tree From Preorder Traversal
  • 1029. Two City Scheduling
  • 1030. Matrix Cells in Distance Order
  • 1031. Maximum Sum of Two Non-Overlapping Subarrays
  • 1032. Stream of Characters
  • 1033. Moving Stones Until Consecutive
  • 1034. Coloring A Border
  • 1035. Uncrossed Lines
  • 1036. Escape a Large Maze
  • 1037. Valid Boomerang
  • 1038. Binary Search Tree to Greater Sum Tree
  • 1039. Minimum Score Triangulation of Polygon
  • 1040. Moving Stones Until Consecutive II
  • 1041. Robot Bounded In Circle
  • 1042. Flower Planting With No Adjacent
  • 1043. Partition Array for Maximum Sum
  • 1044. Longest Duplicate Substring
  • 1046. Last Stone Weight
  • 1047. Remove All Adjacent Duplicates In String
  • 1048. Longest String Chain
  • 1049. Last Stone Weight II
  • 1051. Height Checker
  • 1052. Grumpy Bookstore Owner
  • 1053. Previous Permutation With One Swap
  • 1054. Distant Barcodes
  • 1055. Shortest Way to Form String
  • 1056. Confusing Number
  • 1057. Campus Bikes
  • 1058. Minimize Rounding Error to Meet Target
  • 1059. All Paths from Source Lead to Destination
  • 1060. Missing Element in Sorted Array
  • 1061. Lexicographically Smallest Equivalent String
  • 1062. Longest Repeating Substring
  • 1063. Number of Valid Subarrays
  • 1064. Fixed Point
  • 1065. Index Pairs of a String
  • 1066. Campus Bikes II
  • 1067. Digit Count in Range
  • 1071. Greatest Common Divisor of Strings
  • 1072. Flip Columns For Maximum Number of Equal Rows
  • 1073. Adding Two Negabinary Numbers
  • 1074. Number of Submatrices That Sum to Target
  • 1078. Occurrences After Bigram
  • 1079. Letter Tile Possibilities
  • 1080. Insufficient Nodes in Root to Leaf Paths
  • 1081. Smallest Subsequence of Distinct Characters
  • 1085. Sum of Digits in the Minimum Number
  • 1086. High Five
  • 1087. Brace Expansion
  • 1088. Confusing Number II
  • 1089. Duplicate Zeros
  • 1090. Largest Values From Labels
  • 1091. Shortest Path in Binary Matrix
  • 1092. Shortest Common Supersequence
  • 1093. Statistics from a Large Sample
  • 1094. Car Pooling
  • 1095. Find in Mountain Array
  • 1096. Brace Expansion II
  • 1099. Two Sum Less Than K
  • 1100. Find K-Length Substrings With No Repeated Characters
  • 1101. The Earliest Moment When Everyone Become Friends
  • 1102. Path With Maximum Minimum Value
  • 1103. Distribute Candies to People
  • 1104. Path In Zigzag Labelled Binary Tree
  • 1105. Filling Bookcase Shelves
  • 1106. Parsing A Boolean Expression
  • 1108. Defanging an IP Address
  • 1109. Corporate Flight Bookings
  • 1110. Delete Nodes And Return Forest
  • 1111. Maximum Nesting Depth of Two Valid Parentheses Strings
  • 1114. Print in Order
  • 1115. Print FooBar Alternately
  • 1116. Print Zero Even Odd
  • 1117. Building H2O
  • 1118. Number of Days in a Month
  • 1119. Remove Vowels from a String
  • 1120. Maximum Average Subtree
  • 1121. Divide Array Into Increasing Sequences
  • 1122. Relative Sort Array
  • 1123. Lowest Common Ancestor of Deepest Leaves
  • 1124. Longest Well-Performing Interval
  • 1125. Smallest Sufficient Team
  • 1128. Number of Equivalent Domino Pairs
  • 1129. Shortest Path with Alternating Colors
  • 1130. Minimum Cost Tree From Leaf Values
  • 1131. Maximum of Absolute Value Expression
  • 1133. Largest Unique Number
  • 1134. Armstrong Number
  • 1135. Connecting Cities With Minimum Cost
  • 1136. Parallel Courses
  • 1137. N-th Tribonacci Number
  • 1138. Alphabet Board Path
  • 1139. Largest 1-Bordered Square
  • 1140. Stone Game II
  • 1143. Longest Common Subsequence
  • 1144. Decrease Elements To Make Array Zigzag
  • 1145. Binary Tree Coloring Game
  • 1146. Snapshot Array
  • 1147. Longest Chunked Palindrome Decomposition
  • 1150. Check If a Number Is Majority Element in a Sorted Array
  • 1151. Minimum Swaps to Group All 1's Together
  • 1152. Analyze User Website Visit Pattern
  • 1153. String Transforms Into Another String
  • 1154. Day of the Year
  • 1155. Number of Dice Rolls With Target Sum
  • 1156. Swap For Longest Repeated Character Substring
  • 1157. Online Majority Element In Subarray
  • 1160. Find Words That Can Be Formed by Characters
  • 1161. Maximum Level Sum of a Binary Tree
  • 1162. As Far from Land as Possible
  • 1163. Last Substring in Lexicographical Order
  • 1165. Single-Row Keyboard
  • 1166. Design File System
  • 1167. Minimum Cost to Connect Sticks
  • 1168. Optimize Water Distribution in a Village
  • 1169. Invalid Transactions
  • 1170. Compare Strings by Frequency of the Smallest Character
  • 1171. Remove Zero Sum Consecutive Nodes from Linked List
  • 1172. Dinner Plate Stacks
  • 1175. Prime Arrangements
  • 1176. Diet Plan Performance
  • 1177. Can Make Palindrome from Substring
  • 1178. Number of Valid Words for Each Puzzle
  • 1180. Count Substrings with Only One Distinct Letter
  • 1181. Before and After Puzzle
  • 1182. Shortest Distance to Target Color
  • 1183. Maximum Number of Ones
  • 1184. Distance Between Bus Stops
  • 1185. Day of the Week
  • 1186. Maximum Subarray Sum with One Deletion
  • 1187. Make Array Strictly Increasing
  • 1188. Design Bounded Blocking Queue
  • 1189. Maximum Number of Balloons
  • 1190. Reverse Substrings Between Each Pair of Parentheses
  • 1191. K-Concatenation Maximum Sum
  • 1192. Critical Connections in a Network
  • 1195. Fizz Buzz Multithreaded
  • 1196. How Many Apples Can You Put into the Basket
  • 1197. Minimum Knight Moves
  • 1198. Find Smallest Common Element in All Rows
  • 1199. Minimum Time to Build Blocks
  • 1200. Minimum Absolute Difference
  • 1201. Ugly Number III
  • 1202. Smallest String With Swaps
  • 1203. Sort Items by Groups Respecting Dependencies
  • 1206. Design Skiplist
  • 1207. Unique Number of Occurrences
  • 1208. Get Equal Substrings Within Budget
  • 1209. Remove All Adjacent Duplicates in String II
  • 1210. Minimum Moves to Reach Target with Rotations
  • 1213. Intersection of Three Sorted Arrays
  • 1214. Two Sum BSTs
  • 1215. Stepping Numbers
  • 1216. Valid Palindrome III
  • 1217. Minimum Cost to Move Chips to The Same Position
  • 1218. Longest Arithmetic Subsequence of Given Difference
  • 1219. Path with Maximum Gold
  • 1220. Count Vowels Permutation
  • 1221. Split a String in Balanced Strings
  • 1222. Queens That Can Attack the King
  • 1223. Dice Roll Simulation
  • 1224. Maximum Equal Frequency
  • 1226. The Dining Philosophers
  • 1227. Airplane Seat Assignment Probability
  • 1228. Missing Number In Arithmetic Progression
  • 1229. Meeting Scheduler
  • 1230. Toss Strange Coins
  • 1231. Divide Chocolate
  • 1232. Check If It Is a Straight Line
  • 1233. Remove Sub-Folders from the Filesystem
  • 1234. Replace the Substring for Balanced String
  • 1235. Maximum Profit in Job Scheduling
  • 1236. Web Crawler
  • 1237. Find Positive Integer Solution for a Given Equation
  • 1238. Circular Permutation in Binary Representation
  • 1239. Maximum Length of a Concatenated String with Unique Characters
  • 1240. Tiling a Rectangle with the Fewest Squares
  • 1242. Web Crawler Multithreaded
  • 1243. Array Transformation
  • 1244. Design A Leaderboard
  • 1245. Tree Diameter
  • 1246. Palindrome Removal
  • 1247. Minimum Swaps to Make Strings Equal
  • 1248. Count Number of Nice Subarrays
  • 1249. Minimum Remove to Make Valid Parentheses
  • 1250. Check If It Is a Good Array
  • 1252. Cells with Odd Values in a Matrix
  • 1253. Reconstruct a 2-Row Binary Matrix
  • 1254. Number of Closed Islands
  • 1255. Maximum Score Words Formed by Letters
  • 1256. Encode Number
  • 1257. Smallest Common Region
  • 1258. Synonymous Sentences
  • 1259. Handshakes That Don't Cross
  • 1260. Shift 2D Grid
  • 1261. Find Elements in a Contaminated Binary Tree
  • 1262. Greatest Sum Divisible by Three
  • 1263. Minimum Moves to Move a Box to Their Target Location
  • 1265. Print Immutable Linked List in Reverse
  • 1266. Minimum Time Visiting All Points
  • 1267. Count Servers that Communicate
  • 1268. Search Suggestions System
  • 1269. Number of Ways to Stay in the Same Place After Some Steps
  • 1271. Hexspeak
  • 1272. Remove Interval
  • 1273. Delete Tree Nodes
  • 1274. Number of Ships in a Rectangle
  • 1275. Find Winner on a Tic Tac Toe Game
  • 1276. Number of Burgers with No Waste of Ingredients
  • 1277. Count Square Submatrices with All Ones
  • 1278. Palindrome Partitioning III
  • 1279. Traffic Light Controlled Intersection
  • 1281. Subtract the Product and Sum of Digits of an Integer
  • 1282. Group the People Given the Group Size They Belong To
  • 1283. Find the Smallest Divisor Given a Threshold
  • 1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix
  • 1286. Iterator for Combination
  • 1287. Element Appearing More Than 25% In Sorted Array
  • 1288. Remove Covered Intervals
  • 1289. Minimum Falling Path Sum II
  • 1290. Convert Binary Number in a Linked List to Integer
  • 1291. Sequential Digits
  • 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
  • 1293. Shortest Path in a Grid with Obstacles Elimination
  • 1295. Find Numbers with Even Number of Digits
  • 1296. Divide Array in Sets of K Consecutive Numbers
  • 1297. Maximum Number of Occurrences of a Substring
  • 1298. Maximum Candies You Can Get from Boxes
  • 1299. Replace Elements with Greatest Element on Right Side
  • 1300. Sum of Mutated Array Closest to Target
  • 1301. Number of Paths with Max Score
  • 1302. Deepest Leaves Sum
  • 1304. Find N Unique Integers Sum up to Zero
  • 1305. All Elements in Two Binary Search Trees
  • 1306. Jump Game III
  • 1307. Verbal Arithmetic Puzzle
  • 1309. Decrypt String from Alphabet to Integer Mapping
  • 1310. XOR Queries of a Subarray
  • 1311. Get Watched Videos by Your Friends
  • 1312. Minimum Insertion Steps to Make a String Palindrome
  • 1313. Decompress Run-Length Encoded List
  • 1314. Matrix Block Sum
  • 1315. Sum of Nodes with Even-Valued Grandparent
  • 1316. Distinct Echo Substrings
  • 1317. Convert Integer to the Sum of Two No-Zero Integers
  • 1318. Minimum Flips to Make a OR b Equal to c
  • 1319. Number of Operations to Make Network Connected
  • 1320. Minimum Distance to Type a Word Using Two Fingers
  • 1323. Maximum 69 Number
  • 1324. Print Words Vertically
  • 1325. Delete Leaves With a Given Value
  • 1326. Minimum Number of Taps to Open to Water a Garden
  • 1328. Break a Palindrome
  • 1329. Sort the Matrix Diagonally
  • 1330. Reverse Subarray To Maximize Array Value
  • 1331. Rank Transform of an Array
  • 1332. Remove Palindromic Subsequences
  • 1333. Filter Restaurants by Vegan-Friendly, Price and Distance
  • 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance
  • 1335. Minimum Difficulty of a Job Schedule
  • 1337. The K Weakest Rows in a Matrix
  • 1338. Reduce Array Size to The Half
  • 1339. Maximum Product of Splitted Binary Tree
  • 1340. Jump Game V
  • 1342. Number of Steps to Reduce a Number to Zero
  • 1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
  • 1344. Angle Between Hands of a Clock
  • 1345. Jump Game IV
  • 1346. Check If N and Its Double Exist
  • 1347. Minimum Number of Steps to Make Two Strings Anagram
  • 1348. Tweet Counts Per Frequency
  • 1349. Maximum Students Taking Exam
  • 1351. Count Negative Numbers in a Sorted Matrix
  • 1352. Product of the Last K Numbers
  • 1353. Maximum Number of Events That Can Be Attended
  • 1354. Construct Target Array With Multiple Sums
  • 1356. Sort Integers by The Number of 1 Bits
  • 1357. Apply Discount Every n Orders
  • 1358. Number of Substrings Containing All Three Characters
  • 1359. Count All Valid Pickup and Delivery Options
  • 1360. Number of Days Between Two Dates
  • 1361. Validate Binary Tree Nodes
  • 1362. Closest Divisors
  • 1363. Largest Multiple of Three
  • 1365. How Many Numbers Are Smaller Than the Current Number
  • 1366. Rank Teams by Votes
  • 1367. Linked List in Binary Tree
  • 1368. Minimum Cost to Make at Least One Valid Path in a Grid
  • 1370. Increasing Decreasing String
  • 1371. Find the Longest Substring Containing Vowels in Even Counts
  • 1372. Longest ZigZag Path in a Binary Tree
  • 1373. Maximum Sum BST in Binary Tree
  • 1374. Generate a String With Characters That Have Odd Counts
  • 1375. Number of Times Binary String Is Prefix-Aligned
  • 1376. Time Needed to Inform All Employees
  • 1377. Frog Position After T Seconds
  • 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
  • 1380. Lucky Numbers in a Matrix
  • 1381. Design a Stack With Increment Operation
  • 1382. Balance a Binary Search Tree
  • 1383. Maximum Performance of a Team
  • 1385. Find the Distance Value Between Two Arrays
  • 1386. Cinema Seat Allocation
  • 1387. Sort Integers by The Power Value
  • 1388. Pizza With 3n Slices
  • 1389. Create Target Array in the Given Order
  • 1390. Four Divisors
  • 1391. Check if There is a Valid Path in a Grid
  • 1392. Longest Happy Prefix
  • 1394. Find Lucky Integer in an Array
  • 1395. Count Number of Teams
  • 1396. Design Underground System
  • 1397. Find All Good Strings
  • 1399. Count Largest Group
  • 1400. Construct K Palindrome Strings
  • 1401. Circle and Rectangle Overlapping
  • 1402. Reducing Dishes
  • 1403. Minimum Subsequence in Non-Increasing Order
  • 1404. Number of Steps to Reduce a Number in Binary Representation to One
  • 1405. Longest Happy String
  • 1406. Stone Game III
  • 1408. String Matching in an Array
  • 1409. Queries on a Permutation With Key
  • 1410. HTML Entity Parser
  • 1411. Number of Ways to Paint N × 3 Grid
  • 1413. Minimum Value to Get Positive Step by Step Sum
  • 1414. Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
  • 1415. The k-th Lexicographical String of All Happy Strings of Length n
  • 1416. Restore The Array
  • 1417. Reformat The String
  • 1418. Display Table of Food Orders in a Restaurant
  • 1419. Minimum Number of Frogs Croaking
  • 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons
  • 1422. Maximum Score After Splitting a String
  • 1423. Maximum Points You Can Obtain from Cards
  • 1424. Diagonal Traverse II
  • 1425. Constrained Subsequence Sum
  • 1426. Counting Elements
  • 1427. Perform String Shifts
  • 1428. Leftmost Column with at Least a One
  • 1429. First Unique Number
  • 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
  • 1431. Kids With the Greatest Number of Candies
  • 1432. Max Difference You Can Get From Changing an Integer
  • 1433. Check If a String Can Break Another String
  • 1434. Number of Ways to Wear Different Hats to Each Other
  • 1436. Destination City
  • 1437. Check If All 1's Are at Least Length K Places Away
  • 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
  • 1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows
  • 1441. Build an Array With Stack Operations
  • 1442. Count Triplets That Can Form Two Arrays of Equal XOR
  • 1443. Minimum Time to Collect All Apples in a Tree
  • 1444. Number of Ways of Cutting a Pizza
  • 1446. Consecutive Characters
  • 1447. Simplified Fractions
  • 1448. Count Good Nodes in Binary Tree
  • 1449. Form Largest Integer With Digits That Add up to Target
  • 1450. Number of Students Doing Homework at a Given Time
  • 1451. Rearrange Words in a Sentence
  • 1452. People Whose List of Favorite Companies Is Not a Subset of Another List
  • 1453. Maximum Number of Darts Inside of a Circular Dartboard
  • 1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence
  • 1456. Maximum Number of Vowels in a Substring of Given Length
  • 1457. Pseudo-Palindromic Paths in a Binary Tree
  • 1458. Max Dot Product of Two Subsequences
  • 1460. Make Two Arrays Equal by Reversing Subarrays
  • 1461. Check If a String Contains All Binary Codes of Size K
  • 1462. Course Schedule IV
  • 1463. Cherry Pickup II
  • 1464. Maximum Product of Two Elements in an Array
  • 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
  • 1466. Reorder Routes to Make All Paths Lead to the City Zero
  • 1467. Probability of a Two Boxes Having The Same Number of Distinct Balls
  • 1469. Find All The Lonely Nodes
  • 1470. Shuffle the Array
  • 1471. The k Strongest Values in an Array
  • 1472. Design Browser History
  • 1473. Paint House III
  • 1474. Delete N Nodes After M Nodes of a Linked List
  • 1475. Final Prices With a Special Discount in a Shop
  • 1476. Subrectangle Queries
  • 1477. Find Two Non-overlapping Sub-arrays Each With Target Sum
  • 1478. Allocate Mailboxes
  • 1480. Running Sum of 1d Array
  • 1481. Least Number of Unique Integers after K Removals
  • 1482. Minimum Number of Days to Make m Bouquets
  • 1483. Kth Ancestor of a Tree Node
  • 1485. Clone Binary Tree With Random Pointer
  • 1486. XOR Operation in an Array
  • 1487. Making File Names Unique
  • 1488. Avoid Flood in The City
  • 1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree
  • 1490. Clone N-ary Tree
  • 1491. Average Salary Excluding the Minimum and Maximum Salary
  • 1492. The kth Factor of n
  • 1493. Longest Subarray of 1's After Deleting One Element
  • 1494. Parallel Courses II
  • 1496. Path Crossing
  • 1497. Check If Array Pairs Are Divisible by k
  • 1498. Number of Subsequences That Satisfy the Given Sum Condition
  • 1499. Max Value of Equation
  • 1500. Design a File Sharing System
  • 1502. Can Make Arithmetic Progression From Sequence
  • 1503. Last Moment Before All Ants Fall Out of a Plank
  • 1504. Count Submatrices With All Ones
  • 1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
  • 1506. Find Root of N-Ary Tree
  • 1507. Reformat Date
  • 1508. Range Sum of Sorted Subarray Sums
  • 1509. Minimum Difference Between Largest and Smallest Value in Three Moves
  • 1510. Stone Game IV
  • 1512. Number of Good Pairs
  • 1513. Number of Substrings With Only 1s
  • 1514. Path with Maximum Probability
  • 1515. Best Position for a Service Centre
  • 1516. Move Sub-Tree of N-Ary Tree
  • 1518. Water Bottles
  • 1519. Number of Nodes in the Sub-Tree With the Same Label
  • 1520. Maximum Number of Non-Overlapping Substrings
  • 1521. Find a Value of a Mysterious Function Closest to Target
  • 1522. Diameter of N-Ary Tree
  • 1523. Count Odd Numbers in an Interval Range
  • 1524. Number of Sub-arrays With Odd Sum
  • 1525. Number of Good Ways to Split a String
  • 1526. Minimum Number of Increments on Subarrays to Form a Target Array
  • 1528. Shuffle String
  • 1529. Minimum Suffix Flips
  • 1530. Number of Good Leaf Nodes Pairs
  • 1531. String Compression II
  • 1533. Find the Index of the Large Integer
  • 1534. Count Good Triplets
  • 1535. Find the Winner of an Array Game
  • 1536. Minimum Swaps to Arrange a Binary Grid
  • 1537. Get the Maximum Score
  • 1538. Guess the Majority in a Hidden Array
  • 1539. Kth Missing Positive Number
  • 1540. Can Convert String in K Moves
  • 1541. Minimum Insertions to Balance a Parentheses String
  • 1542. Find Longest Awesome Substring
  • 1544. Make The String Great
  • 1545. Find Kth Bit in Nth Binary String
  • 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
  • 1547. Minimum Cost to Cut a Stick
  • 1548. The Most Similar Path in a Graph
  • 1550. Three Consecutive Odds
  • 1551. Minimum Operations to Make Array Equal
  • 1552. Magnetic Force Between Two Balls
  • 1553. Minimum Number of Days to Eat N Oranges
  • 1554. Strings Differ by One Character
  • 1556. Thousand Separator
  • 1557. Minimum Number of Vertices to Reach All Nodes
  • 1558. Minimum Numbers of Function Calls to Make Target Array
  • 1559. Detect Cycles in 2D Grid
  • 1560. Most Visited Sector in a Circular Track
  • 1561. Maximum Number of Coins You Can Get
  • 1562. Find Latest Group of Size M
  • 1563. Stone Game V
  • 1564. Put Boxes Into the Warehouse I
  • 1566. Detect Pattern of Length M Repeated K or More Times
  • 1567. Maximum Length of Subarray With Positive Product
  • 1568. Minimum Number of Days to Disconnect Island
  • 1569. Number of Ways to Reorder Array to Get Same BST
  • 1570. Dot Product of Two Sparse Vectors
  • 1572. Matrix Diagonal Sum
  • 1573. Number of Ways to Split a String
  • 1574. Shortest Subarray to be Removed to Make Array Sorted
  • 1575. Count All Possible Routes
  • 1576. Replace All 's to Avoid Consecutive Repeating Characters
  • 1577. Number of Ways Where Square of Number Is Equal to Product of Two Numbers
  • 1578. Minimum Time to Make Rope Colorful
  • 1579. Remove Max Number of Edges to Keep Graph Fully Traversable
  • 1580. Put Boxes Into the Warehouse II
  • 1582. Special Positions in a Binary Matrix
  • 1583. Count Unhappy Friends
  • 1584. Min Cost to Connect All Points
  • 1585. Check If String Is Transformable With Substring Sort Operations
  • 1588. Sum of All Odd Length Subarrays
  • 1589. Maximum Sum Obtained of Any Permutation
  • 1590. Make Sum Divisible by P
  • 1591. Strange Printer II
  • 1592. Rearrange Spaces Between Words
  • 1593. Split a String Into the Max Number of Unique Substrings
  • 1594. Maximum Non Negative Product in a Matrix
  • 1595. Minimum Cost to Connect Two Groups of Points
  • 1597. Build Binary Expression Tree From Infix Expression
  • 1598. Crawler Log Folder
  • 1599. Maximum Profit of Operating a Centennial Wheel
  • 1600. Throne Inheritance
  • 1601. Maximum Number of Achievable Transfer Requests
  • 1602. Find Nearest Right Node in Binary Tree
  • 1603. Design Parking System
  • 1604. Alert Using Same Key-Card Three or More Times in a One Hour Period
  • 1605. Find Valid Matrix Given Row and Column Sums
  • 1606. Find Servers That Handled Most Number of Requests
  • 1608. Special Array With X Elements Greater Than or Equal X
  • 1609. Even Odd Tree
  • 1610. Maximum Number of Visible Points
  • 1611. Minimum One Bit Operations to Make Integers Zero
  • 1612. Check If Two Expression Trees are Equivalent
  • 1614. Maximum Nesting Depth of the Parentheses
  • 1615. Maximal Network Rank
  • 1616. Split Two Strings to Make Palindrome
  • 1617. Count Subtrees With Max Distance Between Cities
  • 1618. Maximum Font to Fit a Sentence in a Screen
  • 1619. Mean of Array After Removing Some Elements
  • 1620. Coordinate With Maximum Network Quality
  • 1621. Number of Sets of K Non-Overlapping Line Segments
  • 1622. Fancy Sequence
  • 1624. Largest Substring Between Two Equal Characters
  • 1625. Lexicographically Smallest String After Applying Operations
  • 1626. Best Team With No Conflicts
  • 1627. Graph Connectivity With Threshold
  • 1628. Design an Expression Tree With Evaluate Function
  • 1629. Slowest Key
  • 1630. Arithmetic Subarrays
  • 1631. Path With Minimum Effort
  • 1632. Rank Transform of a Matrix
  • 1634. Add Two Polynomials Represented as Linked Lists
  • 1636. Sort Array by Increasing Frequency
  • 1637. Widest Vertical Area Between Two Points Containing No Points
  • 1638. Count Substrings That Differ by One Character
  • 1639. Number of Ways to Form a Target String Given a Dictionary
  • 1640. Check Array Formation Through Concatenation
  • 1641. Count Sorted Vowel Strings
  • 1642. Furthest Building You Can Reach
  • 1643. Kth Smallest Instructions
  • 1644. Lowest Common Ancestor of a Binary Tree II
  • 1646. Get Maximum in Generated Array
  • 1647. Minimum Deletions to Make Character Frequencies Unique
  • 1648. Sell Diminishing-Valued Colored Balls
  • 1649. Create Sorted Array through Instructions
  • 1650. Lowest Common Ancestor of a Binary Tree III
  • 1652. Defuse the Bomb
  • 1653. Minimum Deletions to Make String Balanced
  • 1654. Minimum Jumps to Reach Home
  • 1655. Distribute Repeating Integers
  • 1656. Design an Ordered Stream
  • 1657. Determine if Two Strings Are Close
  • 1658. Minimum Operations to Reduce X to Zero
  • 1659. Maximize Grid Happiness
  • 1660. Correct a Binary Tree
  • 1662. Check If Two String Arrays are Equivalent
  • 1663. Smallest String With A Given Numeric Value
  • 1664. Ways to Make a Fair Array
  • 1665. Minimum Initial Energy to Finish Tasks
  • 1666. Change the Root of a Binary Tree
  • 1668. Maximum Repeating Substring
  • 1669. Merge In Between Linked Lists
  • 1670. Design Front Middle Back Queue
  • 1671. Minimum Number of Removals to Make Mountain Array
  • 1672. Richest Customer Wealth
  • 1673. Find the Most Competitive Subsequence
  • 1674. Minimum Moves to Make Array Complementary
  • 1675. Minimize Deviation in Array
  • 1676. Lowest Common Ancestor of a Binary Tree IV
  • 1678. Goal Parser Interpretation
  • 1679. Max Number of K-Sum Pairs
  • 1680. Concatenation of Consecutive Binary Numbers
  • 1681. Minimum Incompatibility
  • 1682. Longest Palindromic Subsequence II
  • 1684. Count the Number of Consistent Strings
  • 1685. Sum of Absolute Differences in a Sorted Array
  • 1686. Stone Game VI
  • 1687. Delivering Boxes from Storage to Ports
  • 1688. Count of Matches in Tournament
  • 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers
  • 1690. Stone Game VII
  • 1691. Maximum Height by Stacking Cuboids
  • 1692. Count Ways to Distribute Candies
  • 1694. Reformat Phone Number
  • 1695. Maximum Erasure Value
  • 1696. Jump Game VI
  • 1697. Checking Existence of Edge Length Limited Paths
  • 1698. Number of Distinct Substrings in a String
  • 1700. Number of Students Unable to Eat Lunch
  • 1701. Average Waiting Time
  • 1702. Maximum Binary String After Change
  • 1703. Minimum Adjacent Swaps for K Consecutive Ones
  • 1704. Determine if String Halves Are Alike
  • 1705. Maximum Number of Eaten Apples
  • 1706. Where Will the Ball Fall
  • 1707. Maximum XOR With an Element From Array
  • 1708. Largest Subarray Length K
  • 1709. Biggest Window Between Visits
  • 1710. Maximum Units on a Truck
  • 1711. Count Good Meals
  • 1712. Ways to Split Array Into Three Subarrays
  • 1713. Minimum Operations to Make a Subsequence
  • 1714. Sum Of Special Evenly-Spaced Elements In Array
  • 1716. Calculate Money in Leetcode Bank
  • 1717. Maximum Score From Removing Substrings
  • 1718. Construct the Lexicographically Largest Valid Sequence
  • 1719. Number Of Ways To Reconstruct A Tree
  • 1720. Decode XORed Array
  • 1721. Swapping Nodes in a Linked List
  • 1722. Minimize Hamming Distance After Swap Operations
  • 1723. Find Minimum Time to Finish All Jobs
  • 1724. Checking Existence of Edge Length Limited Paths II
  • 1725. Number Of Rectangles That Can Form The Largest Square
  • 1726. Tuple with Same Product
  • 1727. Largest Submatrix With Rearrangements
  • 1728. Cat and Mouse II
  • 1730. Shortest Path to Get Food
  • 1732. Find the Highest Altitude
  • 1733. Minimum Number of People to Teach
  • 1734. Decode XORed Permutation
  • 1735. Count Ways to Make Array With Product
  • 1736. Latest Time by Replacing Hidden Digits
  • 1737. Change Minimum Characters to Satisfy One of Three Conditions
  • 1738. Find Kth Largest XOR Coordinate Value
  • 1739. Building Boxes
  • 1740. Find Distance in a Binary Tree
  • 1742. Maximum Number of Balls in a Box
  • 1743. Restore the Array From Adjacent Pairs
  • 1744. Can You Eat Your Favorite Candy on Your Favorite Day
  • 1745. Palindrome Partitioning IV
  • 1746. Maximum Subarray Sum After One Operation
  • 1748. Sum of Unique Elements
  • 1749. Maximum Absolute Sum of Any Subarray
  • 1750. Minimum Length of String After Deleting Similar Ends
  • 1751. Maximum Number of Events That Can Be Attended II
  • 1752. Check if Array Is Sorted and Rotated
  • 1753. Maximum Score From Removing Stones
  • 1754. Largest Merge Of Two Strings
  • 1755. Closest Subsequence Sum
  • 1756. Design Most Recently Used Queue
  • 1758. Minimum Changes To Make Alternating Binary String
  • 1759. Count Number of Homogenous Substrings
  • 1760. Minimum Limit of Balls in a Bag
  • 1761. Minimum Degree of a Connected Trio in a Graph
  • 1762. Buildings With an Ocean View
  • 1763. Longest Nice Substring
  • 1764. Form Array by Concatenating Subarrays of Another Array
  • 1765. Map of Highest Peak
  • 1766. Tree of Coprimes
  • 1768. Merge Strings Alternately
  • 1769. Minimum Number of Operations to Move All Balls to Each Box
  • 1770. Maximum Score from Performing Multiplication Operations
  • 1771. Maximize Palindrome Length From Subsequences
  • 1772. Sort Features by Popularity
  • 1773. Count Items Matching a Rule
  • 1774. Closest Dessert Cost
  • 1775. Equal Sum Arrays With Minimum Number of Operations
  • 1776. Car Fleet II
  • 1778. Shortest Path in a Hidden Grid
  • 1779. Find Nearest Point That Has the Same X or Y Coordinate
  • 1780. Check if Number is a Sum of Powers of Three
  • 1781. Sum of Beauty of All Substrings
  • 1782. Count Pairs Of Nodes
  • 1784. Check if Binary String Has at Most One Segment of Ones
  • 1785. Minimum Elements to Add to Form a Given Sum
  • 1786. Number of Restricted Paths From First to Last Node
  • 1787. Make the XOR of All Segments Equal to Zero
  • 1788. Maximize the Beauty of the Garden
  • 1790. Check if One String Swap Can Make Strings Equal
  • 1791. Find Center of Star Graph
  • 1792. Maximum Average Pass Ratio
  • 1793. Maximum Score of a Good Subarray
  • 1794. Count Pairs of Equal Substrings With Minimum Difference
  • 1796. Second Largest Digit in a String
  • 1797. Design Authentication Manager
  • 1798. Maximum Number of Consecutive Values You Can Make
  • 1799. Maximize Score After N Operations
  • 1800. Maximum Ascending Subarray Sum
  • 1801. Number of Orders in the Backlog
  • 1802. Maximum Value at a Given Index in a Bounded Array
  • 1803. Count Pairs With XOR in a Range
  • 1804. Implement Trie II (Prefix Tree)
  • 1805. Number of Different Integers in a String
  • 1806. Minimum Number of Operations to Reinitialize a Permutation
  • 1807. Evaluate the Bracket Pairs of a String
  • 1808. Maximize Number of Nice Divisors
  • 1810. Minimum Path Cost in a Hidden Grid
  • 1811. Find Interview Candidates
  • 1812. Determine Color of a Chessboard Square
  • 1813. Sentence Similarity III
  • 1814. Count Nice Pairs in an Array
  • 1815. Maximum Number of Groups Getting Fresh Donuts
  • 1816. Truncate Sentence
  • 1817. Finding the Users Active Minutes
  • 1818. Minimum Absolute Sum Difference
  • 1819. Number of Different Subsequences GCDs
  • 1820. Maximum Number of Accepted Invitations
  • 1821. Find Customers With Positive Revenue this Year
  • 1822. Sign of the Product of an Array
  • 1823. Find the Winner of the Circular Game
  • 1824. Minimum Sideway Jumps
  • 1825. Finding MK Average
  • 1826. Faulty Sensor
  • 1827. Minimum Operations to Make the Array Increasing
  • 1828. Queries on Number of Points Inside a Circle
  • 1829. Maximum XOR for Each Query
  • 1830. Minimum Number of Operations to Make String Sorted
  • 1831. Maximum Transaction Each Day
  • 1832. Check if the Sentence Is Pangram
  • 1833. Maximum Ice Cream Bars
  • 1834. Single-Threaded CPU
  • 1835. Find XOR Sum of All Pairs Bitwise AND
  • 1836. Remove Duplicates From an Unsorted Linked List
  • 1837. Sum of Digits in Base K
  • 1838. Frequency of the Most Frequent Element
  • 1839. Longest Substring Of All Vowels in Order
  • 1840. Maximum Building Height
  • 1841. League Statistics
  • 1842. Next Palindrome Using Same Digits
  • 1844. Replace All Digits with Characters
  • 1845. Seat Reservation Manager
  • 1846. Maximum Element After Decreasing and Rearranging
  • 1847. Closest Room
  • 1848. Minimum Distance to the Target Element
  • 1849. Splitting a String Into Descending Consecutive Values
  • 1850. Minimum Adjacent Swaps to Reach the Kth Smallest Number
  • 1851. Minimum Interval to Include Each Query
  • 1852. Distinct Numbers in Each Subarray
  • 1853. Convert Date Format
  • 1854. Maximum Population Year
  • 1855. Maximum Distance Between a Pair of Values
  • 1856. Maximum Subarray Min-Product
  • 1857. Largest Color Value in a Directed Graph
  • 1858. Longest Word With All Prefixes
  • 1859. Sorting the Sentence
  • 1860. Incremental Memory Leak
  • 1861. Rotating the Box
  • 1862. Sum of Floored Pairs
  • 1863. Sum of All Subset XOR Totals
  • 1864. Minimum Number of Swaps to Make the Binary String Alternating
  • 1865. Finding Pairs With a Certain Sum
  • 1866. Number of Ways to Rearrange Sticks With K Sticks Visible
  • 1868. Product of Two Run-Length Encoded Arrays
  • 1869. Longer Contiguous Segments of Ones than Zeros
  • 1870. Minimum Speed to Arrive on Time
  • 1871. Jump Game VII
  • 1872. Stone Game VIII
  • 1874. Minimize Product Sum of Two Arrays
  • 1876. Substrings of Size Three with Distinct Characters
  • 1877. Minimize Maximum Pair Sum in Array
  • 1878. Get Biggest Three Rhombus Sums in a Grid
  • 1879. Minimum XOR Sum of Two Arrays
  • 1880. Check if Word Equals Summation of Two Words
  • 1881. Maximum Value after Insertion
  • 1882. Process Tasks Using Servers
  • 1883. Minimum Skips to Arrive at Meeting On Time
  • 1884. Egg Drop With 2 Eggs and N Floors
  • 1885. Count Pairs in Two Arrays
  • 1886. Determine Whether Matrix Can Be Obtained By Rotation
  • 1887. Reduction Operations to Make the Array Elements Equal
  • 1888. Minimum Number of Flips to Make the Binary String Alternating
  • 1889. Minimum Space Wasted From Packaging
  • 1891. Cutting Ribbons
  • 1893. Check if All the Integers in a Range Are Covered
  • 1894. Find the Student that Will Replace the Chalk
  • 1895. Largest Magic Square
  • 1896. Minimum Cost to Change the Final Value of Expression
  • 1897. Redistribute Characters to Make All Strings Equal
  • 1898. Maximum Number of Removable Characters
  • 1899. Merge Triplets to Form Target Triplet
  • 1900. The Earliest and Latest Rounds Where Players Compete
  • 1901. Find a Peak Element II
  • 1902. Depth of BST Given Insertion Order
  • 1903. Largest Odd Number in String
  • 1904. The Number of Full Rounds You Have Played
  • 1905. Count Sub Islands
  • 1906. Minimum Absolute Difference Queries
  • 1908. Game of Nim
  • 1909. Remove One Element to Make the Array Strictly Increasing
  • 1910. Remove All Occurrences of a Substring
  • 1911. Maximum Alternating Subsequence Sum
  • 1912. Design Movie Rental System
  • 1913. Maximum Product Difference Between Two Pairs
  • 1914. Cyclically Rotating a Grid
  • 1915. Number of Wonderful Substrings
  • 1918. Kth Smallest Subarray Sum
  • 1920. Build Array from Permutation
  • 1921. Eliminate Maximum Number of Monsters
  • 1922. Count Good Numbers
  • 1923. Longest Common Subpath
  • 1924. Erect the Fence II
  • 1925. Count Square Sum Triples
  • 1926. Nearest Exit from Entrance in Maze
  • 1927. Sum Game
  • 1928. Minimum Cost to Reach Destination in Time
  • 1929. Concatenation of Array
  • 1930. Unique Length-3 Palindromic Subsequences
  • 1931. Painting a Grid With Three Different Colors
  • 1932. Merge BSTs to Create Single BST
  • 1933. Check if String Is Decomposable Into Value-Equal Substrings
  • 1935. Maximum Number of Words You Can Type
  • 1936. Add Minimum Number of Rungs
  • 1937. Maximum Number of Points with Cost
  • 1938. Maximum Genetic Difference Query
  • 1940. Longest Common Subsequence Between Sorted Arrays
  • 1941. Check if All Characters Have Equal Number of Occurrences
  • 1942. The Number of the Smallest Unoccupied Chair
  • 1943. Describe the Painting
  • 1944. Number of Visible People in a Queue
  • 1945. Sum of Digits of String After Convert
  • 1946. Largest Number After Mutating Substring
  • 1947. Maximum Compatibility Score Sum
  • 1948. Delete Duplicate Folders in System
  • 1950. Maximum of Minimum Values in All Subarrays
  • 1952. Three Divisors
  • 1953. Maximum Number of Weeks for Which You Can Work
  • 1954. Minimum Garden Perimeter to Collect Enough Apples
  • 1955. Count Number of Special Subsequences
  • 1956. Minimum Time For K Virus Variants to Spread
  • 1957. Delete Characters to Make Fancy String
  • 1958. Check if Move is Legal
  • 1959. Minimum Total Space Wasted With K Resizing Operations
  • 1960. Maximum Product of the Length of Two Palindromic Substrings
  • 1961. Check If String Is a Prefix of Array
  • 1962. Remove Stones to Minimize the Total
  • 1963. Minimum Number of Swaps to Make the String Balanced
  • 1964. Find the Longest Valid Obstacle Course at Each Position
  • 1966. Binary Searchable Numbers in an Unsorted Array
  • 1967. Number of Strings That Appear as Substrings in Word
  • 1968. Array With Elements Not Equal to Average of Neighbors
  • 1969. Minimum Non-Zero Product of the Array Elements
  • 1970. Last Day Where You Can Still Cross
  • 1971. Find if Path Exists in Graph
  • 1973. Count Nodes Equal to Sum of Descendants
  • 1974. Minimum Time to Type Word Using Special Typewriter
  • 1975. Maximum Matrix Sum
  • 1976. Number of Ways to Arrive at Destination
  • 1977. Number of Ways to Separate Numbers
  • 1979. Find Greatest Common Divisor of Array
  • 1980. Find Unique Binary String
  • 1981. Minimize the Difference Between Target and Chosen Elements
  • 1982. Find Array Given Subset Sums
  • 1983. Widest Pair of Indices With Equal Range Sum
  • 1984. Minimum Difference Between Highest and Lowest of K Scores
  • 1985. Find the Kth Largest Integer in the Array
  • 1986. Minimum Number of Work Sessions to Finish the Tasks
  • 1987. Number of Unique Good Subsequences
  • 1989. Maximum Number of People That Can Be Caught in Tag
  • 1991. Find the Middle Index in Array
  • 1992. Find All Groups of Farmland
  • 1993. Operations on Tree
  • 1994. The Number of Good Subsets
  • 1995. Count Special Quadruplets
  • 1996. The Number of Weak Characters in the Game
  • 1997. First Day Where You Have Been in All the Rooms
  • 1998. GCD Sort of an Array
  • 1999. Smallest Greater Multiple Made of Two Digits
  • 2000. Reverse Prefix of Word
  • 2001. Number of Pairs of Interchangeable Rectangles
  • 2002. Maximum Product of the Length of Two Palindromic Subsequences
  • 2003. Smallest Missing Genetic Value in Each Subtree
  • 2005. Subtree Removal Game with Fibonacci Tree
  • 2006. Count Number of Pairs With Absolute Difference K
  • 2007. Find Original Array From Doubled Array
  • 2008. Maximum Earnings From Taxi
  • 2009. Minimum Number of Operations to Make Array Continuous
  • 2011. Final Value of Variable After Performing Operations
  • 2012. Sum of Beauty in the Array
  • 2013. Detect Squares
  • 2014. Longest Subsequence Repeated k Times
  • 2015. Average Height of Buildings in Each Segment
  • 2016. Maximum Difference Between Increasing Elements
  • 2017. Grid Game
  • 2018. Check if Word Can Be Placed In Crossword
  • 2019. The Score of Students Solving Math Expression
  • 2021. Brightest Position on Street
  • 2022. Convert 1D Array Into 2D Array
  • 2023. Number of Pairs of Strings With Concatenation Equal to Target
  • 2024. Maximize the Confusion of an Exam
  • 2025. Maximum Number of Ways to Partition an Array
  • 2027. Minimum Moves to Convert String
  • 2028. Find Missing Observations
  • 2029. Stone Game IX
  • 2030. Smallest K Length Subsequence With Occurrences of a Letter
  • 2031. Count Subarrays With More Ones Than Zeros
  • 2032. Two Out of Three
  • 2033. Minimum Operations to Make a Uni-Value Grid
  • 2034. Stock Price Fluctuation
  • 2035. Partition Array Into Two Arrays to Minimize Sum Difference
  • 2036. Maximum Alternating Subarray Sum
  • 2037. Minimum Number of Moves to Seat Everyone
  • 2038. Remove Colored Pieces if Both Neighbors are the Same Color
  • 2039. The Time When the Network Becomes Idle
  • 2040. Kth Smallest Product of Two Sorted Arrays
  • 2042. Check if Numbers Are Ascending in a Sentence
  • 2043. Simple Bank System
  • 2044. Count Number of Maximum Bitwise-OR Subsets
  • 2045. Second Minimum Time to Reach Destination
  • 2046. Sort Linked List Already Sorted Using Absolute Values
  • 2047. Number of Valid Words in a Sentence
  • 2048. Next Greater Numerically Balanced Number
  • 2049. Count Nodes With the Highest Score
  • 2050. Parallel Courses III
  • 2052. Minimum Cost to Separate Sentence Into Rows
  • 2053. Kth Distinct String in an Array
  • 2054. Two Best Non-Overlapping Events
  • 2055. Plates Between Candles
  • 2056. Number of Valid Move Combinations On Chessboard
  • 2057. Smallest Index With Equal Value
  • 2058. Find the Minimum and Maximum Number of Nodes Between Critical Points
  • 2059. Minimum Operations to Convert Number
  • 2060. Check if an Original String Exists Given Two Encoded Strings
  • 2061. Number of Spaces Cleaning Robot Cleaned
  • 2062. Count Vowel Substrings of a String
  • 2063. Vowels of All Substrings
  • 2064. Minimized Maximum of Products Distributed to Any Store
  • 2065. Maximum Path Quality of a Graph
  • 2067. Number of Equal Count Substrings
  • 2068. Check Whether Two Strings are Almost Equivalent
  • 2069. Walking Robot Simulation II
  • 2070. Most Beautiful Item for Each Query
  • 2071. Maximum Number of Tasks You Can Assign
  • 2073. Time Needed to Buy Tickets
  • 2074. Reverse Nodes in Even Length Groups
  • 2075. Decode the Slanted Ciphertext
  • 2076. Process Restricted Friend Requests
  • 2077. Paths in Maze That Lead to Same Room
  • 2078. Two Furthest Houses With Different Colors
  • 2079. Watering Plants
  • 2080. Range Frequency Queries
  • 2081. Sum of k-Mirror Numbers
  • 2083. Substrings That Begin and End With the Same Letter
  • 2085. Count Common Words With One Occurrence
  • 2086. Minimum Number of Food Buckets to Feed the Hamsters
  • 2087. Minimum Cost Homecoming of a Robot in a Grid
  • 2088. Count Fertile Pyramids in a Land
  • 2089. Find Target Indices After Sorting Array
  • 2090. K Radius Subarray Averages
  • 2091. Removing Minimum and Maximum From Array
  • 2092. Find All People With Secret
  • 2093. Minimum Cost to Reach City With Discounts
  • 2094. Finding 3-Digit Even Numbers
  • 2095. Delete the Middle Node of a Linked List
  • 2096. Step-By-Step Directions From a Binary Tree Node to Another
  • 2097. Valid Arrangement of Pairs
  • 2098. Subsequence of Size K With the Largest Even Sum
  • 2099. Find Subsequence of Length K With the Largest Sum
  • 2100. Find Good Days to Rob the Bank
  • 2101. Detonate the Maximum Bombs
  • 2102. Sequentially Ordinal Rank Tracker
  • 2103. Rings and Rods
  • 2104. Sum of Subarray Ranges
  • 2105. Watering Plants II
  • 2106. Maximum Fruits Harvested After at Most K Steps
  • 2107. Number of Unique Flavors After Sharing K Candies
  • 2108. Find First Palindromic String in the Array
  • 2109. Adding Spaces to a String
  • 2110. Number of Smooth Descent Periods of a Stock
  • 2111. Minimum Operations to Make the Array K-Increasing
  • 2113. Elements in Array After Removing and Replacing Elements
  • 2114. Maximum Number of Words Found in Sentences
  • 2115. Find All Possible Recipes from Given Supplies
  • 2116. Check if a Parentheses String Can Be Valid
  • 2117. Abbreviating the Product of a Range
  • 2119. A Number After a Double Reversal
  • 2120. Execution of All Suffix Instructions Staying in a Grid
  • 2121. Intervals Between Identical Elements
  • 2122. Recover the Original Array
  • 2123. Minimum Operations to Remove Adjacent Ones in Matrix
  • 2124. Check if All A's Appears Before All B's
  • 2125. Number of Laser Beams in a Bank
  • 2126. Destroying Asteroids
  • 2127. Maximum Employees to Be Invited to a Meeting
  • 2128. Remove All Ones With Row and Column Flips
  • 2129. Capitalize the Title
  • 2130. Maximum Twin Sum of a Linked List
  • 2131. Longest Palindrome by Concatenating Two Letter Words
  • 2132. Stamping the Grid
  • 2133. Check if Every Row and Column Contains All Numbers
  • 2134. Minimum Swaps to Group All 1's Together II
  • 2135. Count Words Obtained After Adding a Letter
  • 2136. Earliest Possible Day of Full Bloom
  • 2137. Pour Water Between Buckets to Make Water Levels Equal
  • 2138. Divide a String Into Groups of Size k
  • 2139. Minimum Moves to Reach Target Score
  • 2140. Solving Questions With Brainpower
  • 2141. Maximum Running Time of N Computers
  • 2143. Choose Numbers From Two Arrays in Range
  • 2144. Minimum Cost of Buying Candies With Discount
  • 2145. Count the Hidden Sequences
  • 2146. K Highest Ranked Items Within a Price Range
  • 2147. Number of Ways to Divide a Long Corridor
  • 2148. Count Elements With Strictly Smaller and Greater Elements
  • 2149. Rearrange Array Elements by Sign
  • 2150. Find All Lonely Numbers in the Array
  • 2151. Maximum Good People Based on Statements
  • 2152. Minimum Number of Lines to Cover Points
  • 2154. Keep Multiplying Found Values by Two
  • 2155. All Divisions With the Highest Score of a Binary Array
  • 2156. Find Substring With Given Hash Value
  • 2157. Groups of Strings
  • 2158. Amount of New Area Painted Each Day
  • 2160. Minimum Sum of Four Digit Number After Splitting Digits
  • 2161. Partition Array According to Given Pivot
  • 2162. Minimum Cost to Set Cooking Time
  • 2163. Minimum Difference in Sums After Removal of Elements
  • 2164. Sort Even and Odd Indices Independently
  • 2165. Smallest Value of the Rearranged Number
  • 2166. Design Bitset
  • 2167. Minimum Time to Remove All Cars Containing Illegal Goods
  • 2168. Unique Substrings With Equal Digit Frequency
  • 2169. Count Operations to Obtain Zero
  • 2170. Minimum Operations to Make the Array Alternating
  • 2171. Removing Minimum Number of Magic Beans
  • 2172. Maximum AND Sum of Array
  • 2174. Remove All Ones With Row and Column Flips II
  • 2176. Count Equal and Divisible Pairs in an Array
  • 2177. Find Three Consecutive Integers That Sum to a Given Number
  • 2178. Maximum Split of Positive Even Integers
  • 2179. Count Good Triplets in an Array
  • 2180. Count Integers With Even Digit Sum
  • 2181. Merge Nodes in Between Zeros
  • 2182. Construct String With Repeat Limit
  • 2183. Count Array Pairs Divisible by K
  • 2184. Number of Ways to Build Sturdy Brick Wall
  • 2185. Counting Words With a Given Prefix
  • 2186. Minimum Number of Steps to Make Two Strings Anagram II
  • 2187. Minimum Time to Complete Trips
  • 2188. Minimum Time to Finish the Race
  • 2189. Number of Ways to Build House of Cards
  • 2190. Most Frequent Number Following Key In an Array
  • 2191. Sort the Jumbled Numbers
  • 2192. All Ancestors of a Node in a Directed Acyclic Graph
  • 2193. Minimum Number of Moves to Make Palindrome
  • 2194. Cells in a Range on an Excel Sheet
  • 2195. Append K Integers With Minimal Sum
  • 2196. Create Binary Tree From Descriptions
  • 2197. Replace Non Coprime Numbers in Array
  • 2198. Number of Single Divisor Triplets
  • 2200. Find All K-Distant Indices in an Array
  • 2201. Count Artifacts That Can Be Extracted
  • 2202. Maximize the Topmost Element After K Moves
  • 2203. Minimum Weighted Subgraph With the Required Paths
  • 2204. Distance to a Cycle in Undirected Graph
  • 2206. Divide Array Into Equal Pairs
  • 2207. Maximize Number of Subsequences in a String
  • 2208. Minimum Operations to Halve Array Sum
  • 2209. Minimum White Tiles After Covering With Carpets
  • 2210. Count Hills and Valleys in an Array
  • 2211. Count Collisions on a Road
  • 2212. Maximum Points in an Archery Competition
  • 2213. Longest Substring of One Repeating Character
  • 2214. Minimum Health to Beat Game
  • 2215. Find the Difference of Two Arrays
  • 2216. Minimum Deletions to Make Array Beautiful
  • 2217. Find Palindrome With Fixed Length
  • 2218. Maximum Value of K Coins From Piles
  • 2219. Maximum Sum Score of Array
  • 2220. Minimum Bit Flips to Convert Number
  • 2221. Find Triangular Sum of an Array
  • 2222. Number of Ways to Select Buildings
  • 2223. Sum of Scores of Built Strings
  • 2224. Minimum Number of Operations to Convert Time
  • 2225. Find Players With Zero or One Losses
  • 2226. Maximum Candies Allocated to K Children
  • 2227. Encrypt and Decrypt Strings
  • 2229. Check if an Array Is Consecutive
  • 2231. Largest Number After Digit Swaps by Parity
  • 2232. Minimize Result by Adding Parentheses to Expression
  • 2233. Maximum Product After K Increments
  • 2234. Maximum Total Beauty of the Gardens
  • 2235. Add Two Integers
  • 2236. Root Equals Sum of Children
  • 2237. Count Positions on Street With Required Brightness
  • 2239. Find Closest Number to Zero
  • 2240. Number of Ways to Buy Pens and Pencils
  • 2241. Design an ATM Machine
  • 2242. Maximum Score of a Node Sequence
  • 2243. Calculate Digit Sum of a String
  • 2244. Minimum Rounds to Complete All Tasks
  • 2245. Maximum Trailing Zeros in a Cornered Path
  • 2246. Longest Path With Different Adjacent Characters
  • 2247. Maximum Cost of Trip With K Highways
  • 2248. Intersection of Multiple Arrays
  • 2249. Count Lattice Points Inside a Circle
  • 2250. Count Number of Rectangles Containing Each Point
  • 2251. Number of Flowers in Full Bloom
  • 2254. Design Video Sharing Platform
  • 2255. Count Prefixes of a Given String
  • 2256. Minimum Average Difference
  • 2257. Count Unguarded Cells in the Grid
  • 2258. Escape the Spreading Fire
  • 2259. Remove Digit From Number to Maximize Result
  • 2260. Minimum Consecutive Cards to Pick Up
  • 2261. K Divisible Elements Subarrays
  • 2262. Total Appeal of A String
  • 2263. Make Array Non-decreasing or Non-increasing
  • 2264. Largest 3-Same-Digit Number in String
  • 2265. Count Nodes Equal to Average of Subtree
  • 2266. Count Number of Texts
  • 2267. Check if There Is a Valid Parentheses String Path
  • 2268. Minimum Number of Keypresses
  • 2269. Find the K-Beauty of a Number
  • 2270. Number of Ways to Split Array
  • 2271. Maximum White Tiles Covered by a Carpet
  • 2272. Substring With Largest Variance
  • 2273. Find Resultant Array After Removing Anagrams
  • 2274. Maximum Consecutive Floors Without Special Floors
  • 2275. Largest Combination With Bitwise AND Greater Than Zero
  • 2276. Count Integers in Intervals
  • 2277. Closest Node to Path in Tree
  • 2278. Percentage of Letter in String
  • 2279. Maximum Bags With Full Capacity of Rocks
  • 2280. Minimum Lines to Represent a Line Chart
  • 2281. Sum of Total Strength of Wizards
  • 2282. Number of People That Can Be Seen in a Grid
  • 2283. Check if Number Has Equal Digit Count and Digit Value
  • 2284. Sender With Largest Word Count
  • 2285. Maximum Total Importance of Roads
  • 2286. Booking Concert Tickets in Groups
  • 2287. Rearrange Characters to Make Target String
  • 2288. Apply Discount to Prices
  • 2289. Steps to Make Array Non-decreasing
  • 2290. Minimum Obstacle Removal to Reach Corner
  • 2291. Maximum Profit From Trading Stocks
  • 2293. Min Max Game
  • 2294. Partition Array Such That Maximum Difference Is K
  • 2295. Replace Elements in an Array
  • 2296. Design a Text Editor
  • 2297. Jump Game VIII
  • 2299. Strong Password Checker II
  • 2300. Successful Pairs of Spells and Potions
  • 2301. Match Substring After Replacement
  • 2302. Count Subarrays With Score Less Than K
  • 2303. Calculate Amount Paid in Taxes
  • 2304. Minimum Path Cost in a Grid
  • 2305. Fair Distribution of Cookies
  • 2306. Naming a Company
  • 2307. Check for Contradictions in Equations
  • 2309. Greatest English Letter in Upper and Lower Case
  • 2310. Sum of Numbers With Units Digit K
  • 2311. Longest Binary Subsequence Less Than or Equal to K
  • 2312. Selling Pieces of Wood
  • 2313. Minimum Flips in Binary Tree to Get Result
  • 2315. Count Asterisks
  • 2316. Count Unreachable Pairs of Nodes in an Undirected Graph
  • 2317. Maximum XOR After Operations
  • 2318. Number of Distinct Roll Sequences
  • 2319. Check if Matrix Is X-Matrix
  • 2320. Count Number of Ways to Place Houses
  • 2321. Maximum Score Of Spliced Array
  • 2322. Minimum Score After Removals on a Tree
  • 2323. Find Minimum Time to Finish All Jobs II
  • 2325. Decode the Message
  • 2326. Spiral Matrix IV
  • 2327. Number of People Aware of a Secret
  • 2328. Number of Increasing Paths in a Grid
  • 2330. Valid Palindrome IV
  • 2331. Evaluate Boolean Binary Tree
  • 2332. The Latest Time to Catch a Bus
  • 2333. Minimum Sum of Squared Difference
  • 2334. Subarray With Elements Greater Than Varying Threshold
  • 2335. Minimum Amount of Time to Fill Cups
  • 2336. Smallest Number in Infinite Set
  • 2337. Move Pieces to Obtain a String
  • 2338. Count the Number of Ideal Arrays
  • 2340. Minimum Adjacent Swaps to Make a Valid Array
  • 2341. Maximum Number of Pairs in Array
  • 2342. Max Sum of a Pair With Equal Sum of Digits
  • 2343. Query Kth Smallest Trimmed Number
  • 2344. Minimum Deletions to Make Array Divisible
  • 2345. Finding the Number of Visible Mountains
  • 2347. Best Poker Hand
  • 2348. Number of Zero-Filled Subarrays
  • 2349. Design a Number Container System
  • 2350. Shortest Impossible Sequence of Rolls
  • 2351. First Letter to Appear Twice
  • 2352. Equal Row and Column Pairs
  • 2353. Design a Food Rating System
  • 2354. Number of Excellent Pairs
  • 2355. Maximum Number of Books You Can Take
  • 2357. Make Array Zero by Subtracting Equal Amounts
  • 2358. Maximum Number of Groups Entering a Competition
  • 2359. Find Closest Node to Given Two Nodes
  • 2360. Longest Cycle in a Graph
  • 2361. Minimum Costs Using the Train Line
  • 2363. Merge Similar Items
  • 2364. Count Number of Bad Pairs
  • 2365. Task Scheduler II
  • 2366. Minimum Replacements to Sort the Array
  • 2367. Number of Arithmetic Triplets
  • 2368. Reachable Nodes With Restrictions
  • 2369. Check if There is a Valid Partition For The Array
  • 2370. Longest Ideal Subsequence
  • 2371. Minimize Maximum Value in a Grid
  • 2373. Largest Local Values in a Matrix
  • 2374. Node With Highest Edge Score
  • 2375. Construct Smallest Number From DI String
  • 2376. Count Special Integers
  • 2378. Choose Edges to Maximize Score in a Tree
  • 2379. Minimum Recolors to Get K Consecutive Black Blocks
  • 2380. Time Needed to Rearrange a Binary String
  • 2381. Shifting Letters II
  • 2382. Maximum Segment Sum After Removals
  • 2383. Minimum Hours of Training to Win a Competition
  • 2384. Largest Palindromic Number
  • 2385. Amount of Time for Binary Tree to Be Infected
  • 2386. Find the K-Sum of an Array
  • 2387. Median of a Row Wise Sorted Matrix
  • 2389. Longest Subsequence With Limited Sum
  • 2390. Removing Stars From a String
  • 2391. Minimum Amount of Time to Collect Garbage
  • 2392. Build a Matrix With Conditions
  • 2393. Count Strictly Increasing Subarrays
  • 2395. Find Subarrays With Equal Sum
  • 2396. Strictly Palindromic Number
  • 2397. Maximum Rows Covered by Columns
  • 2398. Maximum Number of Robots Within Budget
  • 2399. Check Distances Between Same Letters
  • 2400. Number of Ways to Reach a Position After Exactly k Steps
  • 2401. Longest Nice Subarray
  • 2402. Meeting Rooms III
  • 2403. Minimum Time to Kill All Monsters
  • 2404. Most Frequent Even Element
  • 2405. Optimal Partition of String
  • 2406. Divide Intervals Into Minimum Number of Groups
  • 2407. Longest Increasing Subsequence II
  • 2408. Design SQL
  • 2409. Count Days Spent Together
  • 2410. Maximum Matching of Players With Trainers
  • 2411. Smallest Subarrays With Maximum Bitwise OR
  • 2412. Minimum Money Required Before Transactions
  • 2413. Smallest Even Multiple
  • 2414. Length of the Longest Alphabetical Continuous Substring
  • 2415. Reverse Odd Levels of Binary Tree
  • 2416. Sum of Prefix Scores of Strings
  • 2417. Closest Fair Integer
  • 2418. Sort the People
  • 2419. Longest Subarray With Maximum Bitwise AND
  • 2420. Find All Good Indices
  • 2421. Number of Good Paths
  • 2422. Merge Operations to Turn Array Into a Palindrome
  • 2423. Remove Letter To Equalize Frequency
  • 2424. Longest Uploaded Prefix
  • 2425. Bitwise XOR of All Pairings
  • 2426. Number of Pairs Satisfying Inequality
  • 2427. Number of Common Factors
  • 2428. Maximum Sum of an Hourglass
  • 2429. Minimize XOR
  • 2430. Maximum Deletions on a String
  • 2431. Maximize Total Tastiness of Purchased Fruits
  • 2432. The Employee That Worked on the Longest Task
  • 2433. Find The Original Array of Prefix Xor
  • 2434. Using a Robot to Print the Lexicographically Smallest String
  • 2435. Paths in Matrix Whose Sum Is Divisible by K
  • 2436. Minimum Split Into Subarrays With GCD Greater Than One
  • 2437. Number of Valid Clock Times
  • 2438. Range Product Queries of Powers
  • 2439. Minimize Maximum of Array
  • 2440. Create Components With Same Value
  • 2441. Largest Positive Integer That Exists With Its Negative
  • 2442. Count Number of Distinct Integers After Reverse Operations
  • 2443. Sum of Number and Its Reverse
  • 2444. Count Subarrays With Fixed Bounds
  • 2445. Number of Nodes With Value One
  • 2446. Determine if Two Events Have Conflict
  • 2447. Number of Subarrays With GCD Equal to K
  • 2448. Minimum Cost to Make Array Equal
  • 2449. Minimum Number of Operations to Make Arrays Similar
  • 2450. Number of Distinct Binary Strings After Applying Operations
  • 2451. Odd String Difference
  • 2452. Words Within Two Edits of Dictionary
  • 2453. Destroy Sequential Targets
  • 2454. Next Greater Element IV
  • 2455. Average Value of Even Numbers That Are Divisible by Three
  • 2456. Most Popular Video Creator
  • 2457. Minimum Addition to Make Integer Beautiful
  • 2458. Height of Binary Tree After Subtree Removal Queries
  • 2459. Sort Array by Moving Items to Empty Space
  • 2460. Apply Operations to an Array
  • 2461. Maximum Sum of Distinct Subarrays With Length K
  • 2462. Total Cost to Hire K Workers
  • 2463. Minimum Total Distance Traveled
  • 2464. Minimum Subarrays in a Valid Split
  • 2465. Number of Distinct Averages
  • 2466. Count Ways To Build Good Strings
  • 2467. Most Profitable Path in a Tree
  • 2468. Split Message Based on Limit
  • 2469. Convert the Temperature
  • 2470. Number of Subarrays With LCM Equal to K
  • 2471. Minimum Number of Operations to Sort a Binary Tree by Level
  • 2472. Maximum Number of Non-overlapping Palindrome Substrings
  • 2473. Minimum Cost to Buy Apples
  • 2475. Number of Unequal Triplets in Array
  • 2476. Closest Nodes Queries in a Binary Search Tree
  • 2477. Minimum Fuel Cost to Report to the Capital
  • 2478. Number of Beautiful Partitions
  • 2479. Maximum XOR of Two Non-Overlapping Subtrees
  • 2481. Minimum Cuts to Divide a Circle
  • 2482. Difference Between Ones and Zeros in Row and Column
  • 2483. Minimum Penalty for a Shop
  • 2484. Count Palindromic Subsequences
  • 2485. Find the Pivot Integer
  • 2486. Append Characters to String to Make Subsequence
  • 2487. Remove Nodes From Linked List
  • 2488. Count Subarrays With Median K
  • 2489. Number of Substrings With Fixed Ratio
  • 2490. Circular Sentence
  • 2491. Divide Players Into Teams of Equal Skill
  • 2492. Minimum Score of a Path Between Two Cities
  • 2493. Divide Nodes Into the Maximum Number of Groups
  • 2495. Number of Subarrays Having Even Product
  • 2496. Maximum Value of a String in an Array
  • 2497. Maximum Star Sum of a Graph
  • 2498. Frog Jump II
  • 2499. Minimum Total Cost to Make Arrays Unequal
  • 2500. Delete Greatest Value in Each Row
  • 2501. Longest Square Streak in an Array
  • 2502. Design Memory Allocator
  • 2503. Maximum Number of Points From Grid Queries
  • 2505. Bitwise OR of All Subsequence Sums
  • 2506. Count Pairs Of Similar Strings
  • 2507. Smallest Value After Replacing With Sum of Prime Factors
  • 2508. Add Edges to Make Degrees of All Nodes Even
  • 2509. Cycle Length Queries in a Tree
  • 2510. Check if There is a Path With Equal Number of 0's And 1's
  • 2511. Maximum Enemy Forts That Can Be Captured
  • 2512. Reward Top K Students
  • 2513. Minimize the Maximum of Two Arrays
  • 2514. Count Anagrams
  • 2515. Shortest Distance to Target String in a Circular Array
  • 2516. Take K of Each Character From Left and Right
  • 2517. Maximum Tastiness of Candy Basket
  • 2518. Number of Great Partitions
  • 2519. Count the Number of K-Big Indices
  • 2520. Count the Digits That Divide a Number
  • 2521. Distinct Prime Factors of Product of Array
  • 2522. Partition String Into Substrings With Values at Most K
  • 2523. Closest Prime Numbers in Range
  • 2524. Maximum Frequency Score of a Subarray
  • 2525. Categorize Box According to Criteria
  • 2526. Find Consecutive Integers from a Data Stream
  • 2527. Find Xor-Beauty of Array
  • 2528. Maximize the Minimum Powered City
  • 2529. Maximum Count of Positive Integer and Negative Integer
  • 2530. Maximal Score After Applying K Operations
  • 2531. Make Number of Distinct Characters Equal
  • 2532. Time to Cross a Bridge
  • 2533. Number of Good Binary Strings
  • 2534. Time Taken to Cross the Door
  • 2535. Difference Between Element Sum and Digit Sum of an Array
  • 2536. Increment Submatrices by One
  • 2537. Count the Number of Good Subarrays
  • 2538. Difference Between Maximum and Minimum Price Sum
  • 2539. Count the Number of Good Subsequences
  • 2540. Minimum Common Value
  • 2541. Minimum Operations to Make Array Equal II
  • 2542. Maximum Subsequence Score
  • 2543. Check if Point Is Reachable
  • 2544. Alternating Digit Sum
  • 2545. Sort the Students by Their Kth Score
  • 2546. Apply Bitwise Operations to Make Strings Equal
  • 2547. Minimum Cost to Split an Array
  • 2548. Maximum Price to Fill a Bag
  • 2549. Count Distinct Numbers on Board
  • 2550. Count Collisions of Monkeys on a Polygon
  • 2551. Put Marbles in Bags
  • 2552. Count Increasing Quadruplets
  • 2553. Separate the Digits in an Array
  • 2554. Maximum Number of Integers to Choose From a Range I
  • 2555. Maximize Win From Two Segments
  • 2556. Disconnect Path in a Binary Matrix by at Most One Flip
  • 2557. Maximum Number of Integers to Choose From a Range II
  • 2558. Take Gifts From the Richest Pile
  • 2559. Count Vowel Strings in Ranges
  • 2560. House Robber IV
  • 2561. Rearranging Fruits
  • 2562. Find the Array Concatenation Value
  • 2563. Count the Number of Fair Pairs
  • 2564. Substring XOR Queries
  • 2565. Subsequence With the Minimum Score
  • 2566. Maximum Difference by Remapping a Digit
  • 2567. Minimum Score by Changing Two Elements
  • 2568. Minimum Impossible OR
  • 2569. Handling Sum Queries After Update
  • 2570. Merge Two 2D Arrays by Summing Values
  • 2571. Minimum Operations to Reduce an Integer to 0
  • 2572. Count the Number of Square-Free Subsets
  • 2573. Find the String with LCP
  • 2574. Left and Right Sum Differences
  • 2575. Find the Divisibility Array of a String
  • 2576. Find the Maximum Number of Marked Indices
  • 2577. Minimum Time to Visit a Cell In a Grid
  • 2578. Split With Minimum Sum
  • 2579. Count Total Number of Colored Cells
  • 2580. Count Ways to Group Overlapping Ranges
  • 2581. Count Number of Possible Root Nodes
  • 2582. Pass the Pillow
  • 2583. Kth Largest Sum in a Binary Tree
  • 2584. Split the Array to Make Coprime Products
  • 2585. Number of Ways to Earn Points
  • 2586. Count the Number of Vowel Strings in Range
  • 2587. Rearrange Array to Maximize Prefix Score
  • 2588. Count the Number of Beautiful Subarrays
  • 2589. Minimum Time to Complete All Tasks
  • 2590. Design a Todo List
  • 2591. Distribute Money to Maximum Children
  • 2592. Maximize Greatness of an Array
  • 2593. Find Score of an Array After Marking All Elements
  • 2594. Minimum Time to Repair Cars
  • 2595. Number of Even and Odd Bits
  • 2596. Check Knight Tour Configuration
  • 2597. The Number of Beautiful Subsets
  • 2598. Smallest Missing Non-negative Integer After Operations
  • 2599. Make the Prefix Sum Non-negative
  • 2600. K Items With the Maximum Sum
  • 2601. Prime Subtraction Operation
  • 2602. Minimum Operations to Make All Array Elements Equal
  • 2603. Collect Coins in a Tree
  • 2604. Minimum Time to Eat All Grains
  • 2605. Form Smallest Number From Two Digit Arrays
  • 2606. Find the Substring With Maximum Cost
  • 2607. Make K-Subarray Sums Equal
  • 2608. Shortest Cycle in a Graph
  • 2609. Find the Longest Balanced Substring of a Binary String
  • 2610. Convert an Array Into a 2D Array With Conditions
  • 2611. Mice and Cheese
  • 2612. Minimum Reverse Operations
  • 2613. Beautiful Pairs
  • 2614. Prime In Diagonal
  • 2615. Sum of Distances
  • 2616. Minimize the Maximum Difference of Pairs
  • 2617. Minimum Number of Visited Cells in a Grid
  • 2618. Check if Object Instance of Class
  • 2619. Array Prototype Last
  • 2620. Counter
  • 2621. Sleep
  • 2622. Cache With Time Limit
  • 2623. Memoize
  • 2624. Snail Traversal
  • 2625. Flatten Deeply Nested Array
  • 2626. Array Reduce Transformation
  • 2627. Debounce
  • 2628. JSON Deep Equal
  • 2629. Function Composition
  • 2630. Memoize II
  • 2631. Group By
  • 2632. Curry
  • 2633. Convert Object to JSON String
  • 2634. Filter Elements from Array
  • 2635. Apply Transform Over Each Element in Array
  • 2636. Promise Pool
  • 2637. Promise Time Limit
  • 2638. Count the Number of K-Free Subsets
  • 2639. Find the Width of Columns of a Grid
  • 2640. Find the Score of All Prefixes of an Array
  • 2641. Cousins in Binary Tree II
  • 2642. Design Graph With Shortest Path Calculator
  • 2643. Row With Maximum Ones
  • 2644. Find the Maximum Divisibility Score
  • 2645. Minimum Additions to Make Valid String
  • 2646. Minimize the Total Price of the Trips
  • 2647. Color the Triangle Red
  • 2648. Generate Fibonacci Sequence
  • 2649. Nested Array Generator
  • 2650. Design Cancellable Function
  • 2651. Calculate Delayed Arrival Time
  • 2652. Sum Multiples
  • 2653. Sliding Subarray Beauty
  • 2654. Minimum Number of Operations to Make All Array Elements Equal to 1
  • 2655. Find Maximal Uncovered Ranges
  • 2656. Maximum Sum With Exactly K Elements
  • 2657. Find the Prefix Common Array of Two Arrays
  • 2658. Maximum Number of Fish in a Grid
  • 2659. Make Array Empty
  • 2660. Determine the Winner of a Bowling Game
  • 2661. First Completely Painted Row or Column
  • 2662. Minimum Cost of a Path With Special Roads
  • 2663. Lexicographically Smallest Beautiful String
  • 2664. The Knight’s Tour
  • 2665. Counter II
  • 2666. Allow One Function Call
  • 2667. Create Hello World Function
  • 2670. Find the Distinct Difference Array
  • 2671. Frequency Tracker
  • 2672. Number of Adjacent Elements With the Same Color
  • 2673. Make Costs of Paths Equal in a Binary Tree
  • 2674. Split a Circular Linked List
  • 2675. Array of Objects to Matrix
  • 2676. Throttle
  • 2677. Chunk Array
  • 2678. Number of Senior Citizens
  • 2679. Sum in a Matrix
  • 2680. Maximum OR
  • 2681. Power of Heroes
  • 2682. Find the Losers of the Circular Game
  • 2683. Neighboring Bitwise XOR
  • 2684. Maximum Number of Moves in a Grid
  • 2685. Count the Number of Complete Components
  • 2689. Extract Kth Character From The Rope Tree
  • 2690. Infinite Method Object
  • 2692. Make Object Immutable
  • 2693. Call Function with Custom Context
  • 2694. Event Emitter
  • 2695. Array Wrapper
  • 2696. Minimum String Length After Removing Substrings
  • 2697. Lexicographically Smallest Palindrome
  • 2698. Find the Punishment Number of an Integer
  • 2699. Modify Graph Edge Weights
  • 2700. Differences Between Two Objects
  • 2702. Minimum Operations to Make Numbers Non-positive
  • 2703. Return Length of Arguments Passed
  • 2704. To Be Or Not To Be
  • 2705. Compact Object
  • 2706. Buy Two Chocolates
  • 2707. Extra Characters in a String
  • 2708. Maximum Strength of a Group
  • 2709. Greatest Common Divisor Traversal
  • 2710. Remove Trailing Zeros From a String
  • 2711. Difference of Number of Distinct Values on Diagonals
  • 2712. Minimum Cost to Make All Characters Equal
  • 2713. Maximum Strictly Increasing Cells in a Matrix
  • 2714. Find Shortest Path with K Hops
  • 2715. Timeout Cancellation
  • 2716. Minimize String Length
  • 2717. Semi-Ordered Permutation
  • 2718. Sum of Matrix After Queries
  • 2719. Count of Integers
  • 2721. Execute Asynchronous Functions in Parallel
  • 2722. Join Two Arrays by ID
  • 2723. Add Two Promises
  • 2724. Sort By
  • 2725. Interval Cancellation
  • 2726. Calculator with Method Chaining
  • 2727. Is Object Empty
  • 2728. Count Houses in a Circular Street
  • 2729. Check if The Number is Fascinating
  • 2730. Find the Longest Semi-Repetitive Substring
  • 2731. Movement of Robots
  • 2732. Find a Good Subset of the Matrix
  • 2733. Neither Minimum nor Maximum
  • 2734. Lexicographically Smallest String After Substring Operation
  • 2735. Collecting Chocolates
  • 2736. Maximum Sum Queries
  • 2737. Find the Closest Marked Node
  • 2739. Total Distance Traveled
  • 2740. Find the Value of the Partition
  • 2741. Special Permutations
  • 2742. Painting the Walls
  • 2743. Count Substrings Without Repeating Character
  • 2744. Find Maximum Number of String Pairs
  • 2745. Construct the Longest New String
  • 2746. Decremental String Concatenation
  • 2747. Count Zero Request Servers
  • 2748. Number of Beautiful Pairs
  • 2749. Minimum Operations to Make the Integer Zero
  • 2750. Ways to Split Array Into Good Subarrays
  • 2753. Count Houses in a Circular Street II
  • 2754. Bind Function to Context
  • 2755. Deep Merge of Two Objects
  • 2757. Generate Circular Array Values
  • 2758. Next Day
  • 2759. Convert JSON String to Object
  • 2760. Longest Even Odd Subarray With Threshold
  • 2761. Prime Pairs With Target Sum
  • 2762. Continuous Subarrays
  • 2763. Sum of Imbalance Numbers of All Subarrays
  • 2764. is Array a Preorder of Some ‌Binary Tree
  • 2765. Longest Alternating Subarray
  • 2766. Relocate Marbles
  • 2767. Partition String Into Minimum Beautiful Substrings
  • 2768. Number of Black Blocks
  • 2769. Find the Maximum Achievable Number
  • 2770. Maximum Number of Jumps to Reach the Last Index
  • 2771. Longest Non-decreasing Subarray From Two Arrays
  • 2772. Apply Operations to Make All Array Elements Equal to Zero
  • 2773. Height of Special Binary Tree
  • 2774. Array Upper Bound
  • 2775. Undefined to Null
  • 2776. Convert Callback Based Function to Promise Based Function
  • 2777. Date Range Generator
  • 2778. Sum of Squares of Special Elements
  • 2779. Maximum Beauty of an Array After Applying Operation
  • 2780. Minimum Index of a Valid Split
  • 2781. Length of the Longest Valid Substring
  • 2782. Number of Unique Categories
  • 2784. Check if Array is Good
  • 2785. Sort Vowels in a String
  • 2786. Visit Array Positions to Maximize Score
  • 2787. Ways to Express an Integer as Sum of Powers
  • 2788. Split Strings by Separator
  • 2789. Largest Element in an Array after Merge Operations
  • 2790. Maximum Number of Groups With Increasing Length
  • 2791. Count Paths That Can Form a Palindrome in a Tree
  • 2792. Count Nodes That Are Great Enough
  • 2794. Create Object from Two Arrays
  • 2795. Parallel Execution of Promises for Individual Results Retrieval
  • 2796. Repeat String
  • 2797. Partial Function with Placeholders
  • 2798. Number of Employees Who Met the Target
  • 2799. Count Complete Subarrays in an Array
  • 2800. Shortest String That Contains Three Strings
  • 2801. Count Stepping Numbers in Range
  • 2802. Find The K-th Lucky Number
  • 2803. Factorial Generator
  • 2804. Array Prototype ForEach
  • 2805. Custom Interval
  • 2806. Account Balance After Rounded Purchase
  • 2807. Insert Greatest Common Divisors in Linked List
  • 2808. Minimum Seconds to Equalize a Circular Array
  • 2809. Minimum Time to Make Array Sum At Most x
  • 2810. Faulty Keyboard
  • 2811. Check if it is Possible to Split Array
  • 2812. Find the Safest Path in a Grid
  • 2813. Maximum Elegance of a K-Length Subsequence
  • 2814. Minimum Time Takes to Reach Destination Without Drowning
  • 2815. Max Pair Sum in an Array
  • 2816. Double a Number Represented as a Linked List
  • 2817. Minimum Absolute Difference Between Elements With Constraint
  • 2818. Apply Operations to Maximize Score
  • 2819. Minimum Relative Loss After Buying Chocolates
  • 2821. Delay the Resolution of Each Promise
  • 2822. Inversion of Object
  • 2823. Deep Object Filter
  • 2824. Count Pairs Whose Sum is Less than Target
  • 2825. Make String a Subsequence Using Cyclic Increments
  • 2826. Sorting Three Groups
  • 2827. Number of Beautiful Integers in the Range
  • 2828. Check if a String Is an Acronym of Words
  • 2829. Determine the Minimum Sum of a k-avoiding Array
  • 2830. Maximize the Profit as the Salesman
  • 2831. Find the Longest Equal Subarray
  • 2832. Maximal Range That Each Element Is Maximum in It
  • 2833. Furthest Point From Origin
  • 2834. Find the Minimum Possible Sum of a Beautiful Array
  • 2835. Minimum Operations to Form Subsequence With Target Sum
  • 2836. Maximize Value of Function in a Ball Passing Game
  • 2838. Maximum Coins Heroes Can Collect
  • 2839. Check if Strings Can be Made Equal With Operations I
  • 2840. Check if Strings Can be Made Equal With Operations II
  • 2841. Maximum Sum of Almost Unique Subarray
  • 2842. Count K-Subsequences of a String With Maximum Beauty
  • 2843. Count Symmetric Integers
  • 2844. Minimum Operations to Make a Special Number
  • 2845. Count of Interesting Subarrays
  • 2846. Minimum Edge Weight Equilibrium Queries in a Tree
  • 2847. Smallest Number With Given Digit Product
  • 2848. Points That Intersect With Cars
  • 2849. Determine if a Cell Is Reachable at a Given Time
  • 2850. Minimum Moves to Spread Stones Over Grid
  • 2851. String Transformation
  • 2852. Sum of Remoteness of All Cells
  • 2855. Minimum Right Shifts to Sort the Array
  • 2856. Minimum Array Length After Pair Removals
  • 2857. Count Pairs of Points With Distance k
  • 2858. Minimum Edge Reversals So Every Node Is Reachable
  • 2859. Sum of Values at Indices With K Set Bits
  • 2860. Happy Students
  • 2861. Maximum Number of Alloys
  • 2862. Maximum Element-Sum of a Complete Subset of Indices
  • 2863. Maximum Length of Semi-Decreasing Subarrays
  • 2864. Maximum Odd Binary Number
  • 2865. Beautiful Towers I
  • 2866. Beautiful Towers II
  • 2867. Count Valid Paths in a Tree
  • 2868. The Wording Game
  • 2869. Minimum Operations to Collect Elements
  • 2870. Minimum Number of Operations to Make Array Empty
  • 2871. Split Array Into Maximum Number of Subarrays
  • 2872. Maximum Number of K-Divisible Components
  • 2873. Maximum Value of an Ordered Triplet I
  • 2874. Maximum Value of an Ordered Triplet II
  • 2875. Minimum Size Subarray in Infinite Array
  • 2876. Count Visited Nodes in a Directed Graph
  • 2877. Create a DataFrame from List
  • 2878. Get the Size of a DataFrame
  • 2879. Display the First Three Rows
  • 2880. Select Data
  • 2881. Create a New Column
  • 2882. Drop Duplicate Rows
  • 2883. Drop Missing Data
  • 2884. Modify Columns
  • 2885. Rename Columns
  • 2886. Change Data Type
  • 2887. Fill Missing Data
  • 2888. Reshape Data Concatenate
  • 2889. Reshape Data Pivot
  • 2890. Reshape Data Melt
  • 2891. Method Chaining
  • 2892. Minimizing Array After Replacing Pairs With Their Product
  • 2894. Divisible and Non-divisible Sums Difference
  • 2895. Minimum Processing Time
  • 2896. Apply Operations to Make Two Strings Equal
  • 2897. Apply Operations on Array to Maximize Sum of Squares
  • 2898. Maximum Linear Stock Score
  • 2899. Last Visited Integers
  • 2900. Longest Unequal Adjacent Groups Subsequence I
  • 2901. Longest Unequal Adjacent Groups Subsequence II
  • 2902. Count of Sub-Multisets With Bounded Sum
  • 2903. Find Indices With Index and Value Difference I
  • 2904. Shortest and Lexicographically Smallest Beautiful String
  • 2905. Find Indices With Index and Value Difference II
  • 2906. Construct Product Matrix
  • 2907. Maximum Profitable Triplets With Increasing Prices I
  • 2908. Minimum Sum of Mountain Triplets I
  • 2909. Minimum Sum of Mountain Triplets II
  • 2910. Minimum Number of Groups to Create a Valid Assignment
  • 2911. Minimum Changes to Make K Semi-palindromes
  • 2912. Number of Ways to Reach Destination in the Grid
  • 2913. Subarrays Distinct Element Sum of Squares I
  • 2914. Minimum Number of Changes to Make Binary String Beautiful
  • 2917. Find the K-or of an Array
  • 2918. Minimum Equal Sum of Two Arrays After Replacing Zeros
  • 2919. Minimum Increment Operations to Make Array Beautiful
  • 2920. Maximum Points After Collecting Coins From All Nodes
  • 2921. Maximum Profitable Triplets With Increasing Prices II
  • 2923. Find Champion I
  • 2924. Find Champion II
  • 2925. Maximum Score After Applying Operations on a Tree
  • 2926. Maximum Balanced Subsequence Sum
  • 2927. Distribute Candies Among Children III
  • 2928. Distribute Candies Among Children I
  • 2929. Distribute Candies Among Children II
  • 2930. Number of Strings Which Can Be Rearranged to Contain Substring
  • 2931. Maximum Spending After Buying Items
  • 2932. Maximum Strong Pair XOR I
  • 2933. High-Access Employees
  • 2934. Minimum Operations to Maximize Last Elements in Arrays
  • 2935. Maximum Strong Pair XOR II
  • 2936. Number of Equal Numbers Blocks
  • 2937. Make Three Strings Equal
  • 2938. Separate Black and White Balls
  • 2939. Maximum Xor Product
  • 2940. Find Building Where Alice and Bob Can Meet
  • 2941. Maximum GCD-Sum of a Subarray
  • 2942. Find Words Containing Character
  • 2943. Maximize Area of Square Hole in Grid
  • 2944. Minimum Number of Coins for Fruits
  • 2945. Find Maximum Non-decreasing Array Length
  • 2946. Matrix Similarity After Cyclic Shifts
  • 2947. Count Beautiful Substrings I
  • 2948. Make Lexicographically Smallest Array by Swapping Elements
  • 2950. Number of Divisible Substrings
  • 2951. Find the Peaks
  • 2952. Minimum Number of Coins to be Added
  • 2953. Count Complete Substrings
  • 2954. Count the Number of Infection Sequences
  • 2955. Number of Same-End Substrings
  • 2956. Find Common Elements Between Two Arrays
  • 2957. Remove Adjacent Almost-Equal Characters
  • 2958. Length of Longest Subarray With at Most K Frequency
  • 2959. Number of Possible Sets of Closing Branches
  • 2960. Count Tested Devices After Test Operations
  • 2961. Double Modular Exponentiation
  • 2962. Count Subarrays Where Max Element Appears at Least K Times
  • 2963. Count the Number of Good Partitions
  • 2964. Number of Divisible Triplet Sums
  • 2965. Find Missing and Repeated Values
  • 2966. Divide Array Into Arrays With Max Difference
  • 2967. Minimum Cost to Make Array Equalindromic
  • 2968. Apply Operations to Maximize Frequency Score
  • 2969. Minimum Number of Coins for Fruits II
  • 2970. Count the Number of Incremovable Subarrays I
  • 2971. Find Polygon With the Largest Perimeter
  • 2972. Count the Number of Incremovable Subarrays II
  • 2973. Find Number of Coins to Place in Tree Nodes
  • 2974. Minimum Number Game
  • 2975. Maximum Square Area by Removing Fences From a Field
  • 2976. Minimum Cost to Convert String I
  • 2977. Minimum Cost to Convert String II
  • 2979. Most Expensive Item That Can Not Be Bought
  • 2980. Check if Bitwise OR Has Trailing Zeros
  • 2981. Find Longest Special Substring That Occurs Thrice I
  • 2982. Find Longest Special Substring That Occurs Thrice II
  • 2983. Palindrome Rearrangement Queries
  • 2992. Number of Self-Divisible Permutations
  • 2996. Smallest Missing Integer Greater Than Sequential Prefix Sum
  • 2997. Minimum Number of Operations to Make Array XOR Equal to K
  • 2998. Minimum Number of Operations to Make X and Y Equal
  • 2999. Count the Number of Powerful Integers
  • 3000. Maximum Area of Longest Diagonal Rectangle
  • 3001. Minimum Moves to Capture The Queen
  • 3002. Maximum Size of a Set After Removals
  • 3003. Maximize the Number of Partitions After Operations
  • 3004. Maximum Subtree of the Same Color
  • 3005. Count Elements With Maximum Frequency
  • 3006. Find Beautiful Indices in the Given Array I
  • 3007. Maximum Number That Sum of the Prices Is Less Than or Equal to K
  • 3008. Find Beautiful Indices in the Given Array II
  • 3009. Maximum Number of Intersections on the Chart
  • 3010. Divide an Array Into Subarrays With Minimum Cost I
  • 3011. Find if Array Can Be Sorted
  • 3012. Minimize Length of Array Using Operations
  • 3013. Divide an Array Into Subarrays With Minimum Cost II
  • 3014. Minimum Number of Pushes to Type Word I
  • 3015. Count the Number of Houses at a Certain Distance I
  • 3016. Minimum Number of Pushes to Type Word II
  • 3017. Count the Number of Houses at a Certain Distance II
  • 3018. Maximum Number of Removal Queries That Can Be Processed I
  • 3019. Number of Changing Keys
  • 3020. Find the Maximum Number of Elements in Subset
  • 3021. Alice and Bob Playing Flower Game
  • 3022. Minimize OR of Remaining Elements Using Operations
  • 3023. Find Pattern in Infinite Stream I
  • 3024. Type of Triangle
  • 3025. Find the Number of Ways to Place People I
  • 3026. Maximum Good Subarray Sum
  • 3027. Find the Number of Ways to Place People II
  • 3028. Ant on the Boundary
  • 3029. Minimum Time to Revert Word to Initial State I
  • 3030. Find the Grid of Region Average
  • 3031. Minimum Time to Revert Word to Initial State II
  • 3032. Count Numbers With Unique Digits II
  • 3033. Modify the Matrix
  • 3034. Number of Subarrays That Match a Pattern I
  • 3035. Maximum Palindromes After Operations
  • 3036. Number of Subarrays That Match a Pattern II
  • 3038. Maximum Number of Operations With the Same Score I
  • 3039. Apply Operations to Make String Empty
  • 3040. Maximum Number of Operations With the Same Score II
  • 3042. Count Prefix and Suffix Pairs I
  • 3043. Find the Length of the Longest Common Prefix
  • 3044. Most Frequent Prime
  • 3045. Count Prefix and Suffix Pairs II
  • 3046. Split the Array
  • 3047. Find the Largest Area of Square Inside Two Rectangles
  • 3048. Earliest Second to Mark Indices I
  • 3062. Winner of the Linked List Game
  • 3063. Linked List Frequency
  • 3064. Guess the Number Using Bitwise Questions I
  • 3065. Minimum Operations to Exceed Threshold Value I
  • 3066. Minimum Operations to Exceed Threshold Value II
  • 3067. Count Pairs of Connectable Servers in a Weighted Tree Network
  • 3069. Distribute Elements Into Two Arrays I
  • 3070. Count Submatrices with Top-Left Element and Sum Less Than k
  • 3071. Minimum Operations to Write the Letter Y on a Grid
  • 3072. Distribute Elements Into Two Arrays II
  • 3073. Maximum Increasing Triplet Value
  • 3074. Apple Redistribution into Boxes
  • 3075. Maximize Happiness of Selected Children
  • 3076. Shortest Uncommon Substring in an Array
  • 3077. Maximum Strength of K Disjoint Subarrays
  • 3078. Match Alphanumerical Pattern in Matrix I

Problem Description

The problem at hand requires us to perform the multiplication of two sparse matrices. A sparse matrix is a matrix that is comprised mostly of zero values. The input consists of two matrices mat1 and mat2 where mat1 is of size m x k and mat2 is of size k x n . The task is to compute the matrix product of mat1 and mat2 and return the resulting matrix. It's assumed that the multiplication of the given matrices is always valid, which means that the number of columns in mat1 is equal to the number of rows in mat2 . The output should also be in the form of a sparse matrix where the spaces are optimized to store only non-zero values as much as possible.

The intuitive approach to matrix multiplication involves three nested loops, iterating through each row of the first matrix and each column of the second matrix to calculate the values of the resulting matrix. However, since we are given a condition that these are sparse matrices, many of these calculations will involve multiplication by zero, which is unnecessary and can be skipped to save computation time and space.

The idea behind the solution approach is to preprocess each input matrix to filter out all the zero values and keep track of the non-zero values along with their positions. This preprocessing step helps to perform multiplication operations only when it is needed (i.e., only with the non-zero values).

The function f(mat) in the provided solution converts a matrix into a list of lists, where each sublist contains tuples. Each tuple has two elements: the column index and the value of the non-zero element in the matrix. This effectively compresses the matrix to store only the necessary information needed for the multiplication.

Once we have these compressed representations g1 and g2 of mat1 and mat2 , respectively, we create an answer matrix ans initialized with zeros. For each row of mat1 , we look at the non-zero values and their column indexes. For each of these non-zero values, we find the respective row (with matching column index) in g2 and multiply the corresponding elements. The product is then added to the correct position in the answer matrix.

This approach significantly reduces the number of multiplication operations, particularly when the matrices have a lot of zeros, which is very common in applications that deal with sparse data.

Solution Approach

The solution follows a two-step approach: preprocessing the input matrices to extract the non-zero values with their positions, and then performing a modified multiplication that only operates with these non-zero values.

Preprocessing Step

The preprocessing function f(mat) is a decisive optimization in the algorithm. It takes advantage of the matrix's sparsity to reduce the complexity of the multiplication step. The function goes through each element of the given matrix mat and records the column index and the value of all non-zero elements in a new data structure which we refer to as g .

For every row i in mat , a list g[i] is created. For every non-zero element x in row , a tuple (j, x) is appended to g[i] , where j is the column index of x . This results in a list of lists where each sublist represents a row and contains only the relevant data for multiplication - that is, the column position and value of non-zero elements.

Matrix Multiplication Step

Once we have applied f to both mat1 and mat2 , obtaining g1 and g2 , we proceed to the actual multiplication.

We initialize the answer matrix ans with the correct dimensions m x n and fill it with zeros. To do this, we build a list of lists with m sublists each containing n zeros. {[0] * n for _ in range(m)} creates a list with m elements, each of which is a list of n zeros.

We then iterate through each row i of mat1 . For each non-zero element x in this row (represented as a tuple (k, x) in g1[i] ), we perform the next steps:

  • For every tuple (j, y) in g2[k] , which represents the non-zero elements of the k-th row in mat2 , we multiply the value x from mat1 with the value y from mat2 , and accumulate the product into the appropriate cell in the answer matrix ans[i][j] .

This accumulator step, ans[i][j] += x * y , is the core of matrix multiplication. It adds up the product of corresponding elements from pairwise aligned rows of mat1 and columns of mat2 .

The nested loops over g1[i] and g2[k] ensure that we only consider terms that contribute to the final answer, avoiding the needless multiplication by zero which is the central inefficiency in dense matrix multiplication.

This algorithm maintains an efficient computation by only considering the relevant (non-zero) elements in the multiplication, significantly speeding it up for sparse matrices. The use of list comprehensions and tuple unpacking in Python contributes to the readability and conciseness of the code, while the use of a list of lists as a data structure allows for fast access and update of individual elements.

Ready to land your dream job?

Unlock your dream job with a 2-minute evaluator for a personalized learning plan, example walkthrough.

Let's walk through a simple example to illustrate the solution approach. Suppose we have the following two sparse matrices mat1 and mat2 .

mat1 (2x3 matrix):

mat2 (3x2 matrix):

The expected result of the multiplication will be a 2x2 matrix. Now, let's use the solution approach to calculate this.

First, we preprocess mat1 and mat2 into their sparse representations g1 and g2 using function f(mat) . Non-zero values and their column indices are kept.

Result of f(mat1) is g1 (list of lists of tuples):

Result of f(mat2) is g2 (list of lists of tuples):

Next, we perform the matrix multiplication:

  • Initialize the answer matrix ans filled with zeros. In this case, an 2x2 matrix would look like:

For each row i in g1 , and for each tuple (k, x) in g1[i] , we do the following:

If i is 0 (first row in mat1 ), we process g1[0] , which is [(0, 1)] . There's only one non-zero value 1 at column 0 . We find all non-zero elements in row 0 of g2 and multiply:

  • We multiply 1 (from g1[0][0]) * 1 (from g2[0][0]) and add it to ans[0][0] .
  • We multiply 1 (from g1[0][0]) * 2 (from g2[0][1]) and add it to ans[0][1] .

If i is 1 (second row in mat1 ), we process g1[1] , which is [(2, 3)] . There's only one non-zero value 3 at column 2 . We find all non-zero elements in row 2 of g2 and multiply:

  • We multiply 3 (from g1[1][0]) * 4 (from g2[2][1]) and add it to ans[1][1] .

The ans matrix now contains the result of the multiplication:

This walk-through illustrates how the algorithm efficiently performs multiplication by directly accessing the non-zero elements and their positions, avoiding unnecessary multiplications with zero, which would not contribute to the result.

Solution Implementation

Time and space complexity, time complexity.

To analyze time complexity, let's examine the code step by step.

Function f(mat) : Sparse Matrix Representation - This function converts a regular matrix to a sparse representation by recording non-zero elements' coordinates and their values. If mat has dimensions r x c with t non-zero elements, then this function would take O(r * c) time, assuming the worst case where every element needs to be checked.

Conversion to Sparse Representation - g1 = f(mat1) is called for the first matrix having dimensions m x k (assuming m rows and k columns), and g2 = f(mat2) for the second matrix having dimensions k x n . The total time for these calls is O(m * k) + O(k * n) = O(m * k + k * n) .

Matrix Multiplication - The nested loops for matrix multiplication iterate over m rows of mat1 , k sparse columns of mat1 , and n sparse columns of mat2 . The number of iterations would be dependent on the number of non-zero elements in the sparse representations of mat1 and mat2 . If nz1 and nz2 are the number of non-zero entries in mat1 and mat2 respectively, the time complexity for the multiplication part is O(nz1 * n) + O(nz2) because for every non-zero element in g1[i] , we need to iterate over potentially up to n elements in g2[k] . However, in a truly sparse scenario, not every element in g2[k] correlates to a non-zero product, so this is an upper bound.

The overall time complexity would be O(m * k + k * n + nz1 * n + nz2) which is typically represented as O(m * k + k * n) if we are looking at worst-case scenario considering dense matrices, where nz1 approaches m * k and nz2 approaches k * n .

Space Complexity

For space complexity, we have:

Sparse Representation - Storing the sparse representation of both matrices, which might take up to O(m * k + k * n) space in the worst case (each original matrix is dense), but in practice would be O(nz1 + nz2) for sparse matrices with nz1 and nz2 non-zero entries respectively.

Output Matrix ans - Initializing a result matrix of dimensions m x n , thus requiring space complexity of O(m * n) .

The space complexity is dominated by the larger of the two factors: output matrix and sparse representations. Therefore, the space complexity is O(m * n + nz1 + nz2) . In worst-case scenario with dense matrices, this would simplify to O(m * n) .

Learn more about how to find time and space complexity quickly using problem constraints .

In a binary min heap, the minimum element can be found in:

Recommended Readings

Patterns The Shortest Path Algorithm for Coding Interviews The goal of AlgoMonster is to help you get a job in the shortest amount of time possible in a data driven way We compiled datasets of tech interview problems and broke them down by patterns This way we can determine the

Recursion Recursion is one of the most important concepts in computer science Simply speaking recursion is the process of a function calling itself Using a real life analogy imagine a scenario where you invite your friends to lunch https algomonster s3 us east 2 amazonaws com recursion jpg You first

Runtime Overview When learning about algorithms and data structures you'll frequently encounter the term time complexity This concept is fundamental in computer science and offers insights into how long an algorithm takes to complete given a certain input size What is Time Complexity Time complexity represents the amount of time

Got a question?  Ask the Monster Assistant  anything you don't understand.

Still not clear?   Submit  the part you don't understand to our editors. Or join our  Discord and ask the community.

matrix multiplication homework

Dive into our free, detailed pattern charts and company guides to understand what each company focuses on.

Monster Assistant is thinking...

Matrix Multiplication

Using a matrix to mulitply 2-digit by 1-digit numbers to help with mental math.

You are now leaving TVOKids.com

TVOKids doesn't have control over the new place you're about to visit, so please make sure you get your Parent or Guardian's permission first!

Do you have permission from your Parents / Guardian to go to other websites?

Before you visit our TVOkids.com YouTube channel, please make sure you have your Parent or Guardian's permission first. TVOkids doesn't have control over the YouTube experience.

To proceed, please enter the correct answer

Incorrect, please try again

Thank you for considering donating to TVO

To confirm that you are a parent, solve

Logo image

LAFF-On Programming for High Performance: ulaff.net

Robert van de Geijn, Margaret Myers, Devangi Parikh

Unit 1.3.5 Matrix-vector multiplication via axpy operations

Homework 1.3.5.1 ..

matrix multiplication homework

We now discuss how matrix-vector multiplication can be cast in terms of axpy operations.

We capture the insights from this last exercise: Partition \(m \times n \) matrix \(A \) by columns and \(x \) by individual elements.

If we then expose the individual elements of \(A \) and \(y \) we get

This discussion explains the JI loop for computing \(y := A x + y \text{:}\)

What it also demonstrates is how matrix-vector multiplication can be implemented as a sequence of axpy operations.

Homework 1.3.5.2 .

#define alpha( i,j ) A[ (j)*ldA + i ] // map alpha( i,j ) to array A #define chi( i ) x[ (i)*incx ] // map chi( i ) to array x #define psi( i ) y[ (i)*incy ] // map psi( i ) to array y void Axpy( int, double, double *, int, double *, int ); void MyGemv( int m, int n, double *A, int ldA, double *x, int incx, double *y, int incy ) { for ( int j=0; j<n; j++ ) Axpy( , , , , , ); }

make J_Axpy

Remark 1.3.5 .

The file name Gemv_J_Axpy.c can be decoded as follows:

The Gemv stands for "GEneral Matrix-Vector multiplication."

The J indicates a loop indexed by \(j\) (a loop over columns of the matrix).

The Axpy indicates that the operation performed in the body of the loop is an axpy operation.

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

Optimized matrix multiplication in C

I'm trying to compare different methods for matrix multiplication. The first one is normal method:

The second one consist of transposing the matrix B first and then do the multiplication by rows:

The second method supposed to be much faster, because we are accessing contiguous memory slots, but I'm not getting a significant improvement in the performance. Am I doing something wrong?

I can post the complete code, but I think is not needed.

UpAndAdam's user avatar

  • 4 Unless you are implementing your own matrix multiplication routines as a learning exercise you should seriously consider using an existing, vetted, optimized library such as BLAS or LAPACK . –  maerics Commented Feb 21, 2013 at 16:33
  • The first fragment has 3 { and 4 } . My impression is that the innermost } is not wanted at all, and the assignment MatrixR[j][k] = suma; is not part of the innermost for loop, despite the indentation (so it is mis-indented; it should be at the same level as suma = 0; ). –  Jonathan Leffler Commented Aug 5, 2018 at 5:47
  • 1 This answer might be helpful: stackoverflow.com/a/54546544/3234205 –  Jianyu Huang Commented Feb 6, 2019 at 4:34

14 Answers 14

What Every Programmer Should Know About Memory (pdf link) by Ulrich Drepper has a lot of good ideas about memory efficiency, but in particular, he uses matrix multiplication as an example of how knowing about memory and using that knowledge can speed this process. Look at appendix A.1 in his paper, and read through section 6.2.1. Table 6.2 in the paper shows that he could get his running time to be 10% from a naive implementation's time for a 1000x1000 matrix.

Granted, his final code is pretty hairy and uses a lot of system-specific stuff and compile-time tuning, but still, if you really need speed, reading that paper and reading his implementation is definitely worth it.

Alok Singhal's user avatar

  • 25 If you really need speed, just use a correct BLAS implementation and don't roll up your linear algebra routines yourself. –  Alexandre C. Commented Jun 3, 2012 at 22:19
  • Ulrich Drepper is my hero. –  Ciro Santilli OurBigBook.com Commented Mar 13, 2017 at 9:46

Getting this right is non-trivial. Using an existing BLAS library is highly recommended.

Should you really be inclined to roll your own matrix multiplication, loop tiling is an optimization that is of particular importance for large matrices. The tiling should be tuned to the cache size to ensure that the cache is not being continually thrashed, which will occur with a naive implementation. I once measured a 12x performance difference tiling a matrix multiply with matrix sizes picked to consume multiples of my cache (circa '97 so the cache was probably small).

Loop tiling algorithms assume that a contiguous linear array of elements is used, as opposed to rows or columns of pointers. With such a storage choice, your indexing scheme determines which dimension changes fastest, and you are free to decide whether row or column access will have the best cache performance.

There's a lot of literature on the subject. The following references, especially the Banerjee books, may be helpful:

[Ban93] Banerjee, Utpal, Loop Transformations for Restructuring Compilers: the Foundations, Kluwer Academic Publishers, Norwell, MA, 1993.

[Ban94] Banerjee, Utpal, Loop Parallelization, Kluwer Academic Publishers, Norwell, MA, 1994.

[BGS93] Bacon, David F., Susan L. Graham, and Oliver Sharp, Compiler Transformations for High-Performance Computing, Computer Science Division, University of California, Berkeley, Calif., Technical Report No UCB/CSD-93-781.

[LRW91] Lam, Monica S., Edward E. Rothberg, and Michael E Wolf. The Cache Performance and Optimizations of Blocked Algorithms, In 4th International Conference on Architectural Support for Programming Languages, held in Santa Clara, Calif., April, 1991, 63-74.

[LW91] Lam, Monica S., and Michael E Wolf. A Loop Transformation Theory and an Algorithm to Maximize Parallelism, In IEEE Transactions on Parallel and Distributed Systems, 1991, 2(4):452-471.

[PW86] Padua, David A., and Michael J. Wolfe, Advanced Compiler Optimizations for Supercomputers, In Communications of the ACM, 29(12):1184-1201, 1986.

[Wolfe89] Wolfe, Michael J. Optimizing Supercompilers for Supercomputers, The MIT Press, Cambridge, MA, 1989.

[Wolfe96] Wolfe, Michael J., High Performance Compilers for Parallel Computing, Addison-Wesley, CA, 1996.

Peeter Joot's user avatar

ATTENTION: You have a BUG in your second implementation

When you do f=0, c=1

you overwrite MatrixB[0][1] and lose that value! When the loop gets to f=1, c=0

the value copied is the same that was already there.

pmg's user avatar

  • Oh! I see, should I use a tmp matrix? That will increase the time even more than the first method –  Peter Commented Dec 15, 2009 at 14:41
  • You can transpose the matrix with one temporary variable: for (f=0; f<i-1; f++) for (co=f+1; co<i; co++) swap(MatrixB[f]+co, MatrixB[co]+f); –  pmg Commented Dec 16, 2009 at 8:58

You should not write matrix multiplication. You should depend on external libraries. In particular you should use the GEMM routine from the BLAS library. GEMM often provides the following optimizations

Efficient Matrix Multiplication relies on blocking your matrix and performing several smaller blocked multiplies. Ideally the size of each block is chosen to fit nicely into cache greatly improving performance .

The ideal block size depends on the underlying memory hierarchy (how big is the cache?). As a result libraries should be tuned and compiled for each specific machine. This is done, among others, by the ATLAS implementation of BLAS .

Assembly Level Optimization

Matrix multiplicaiton is so common that developers will optimize it by hand . In particular this is done in GotoBLAS .

Heterogeneous(GPU) Computing

Matrix Multiply is very FLOP/compute intensive, making it an ideal candidate to be run on GPUs. cuBLAS and MAGMA are good candidates for this.

In short, dense linear algebra is a well studied topic. People devote their lives to the improvement of these algorithms. You should use their work; it will make them happy.

MRocklin's user avatar

  • That is only true if the matrices are large enough to justify the usage of more complex algorithms implemented in BLAS (AFAIK there is no fast path for small matrices). But +1 for citing the GEMM ("general matrix multiplication") routines, and explaining why it helps. –  mctylr Commented May 23, 2014 at 14:21

If the matrix is not large enough or you don't repeat the operations a high number of times you won't see appreciable differences.

If the matrix is, say, 1,000x1,000 you will begin to see improvements, but I would say that if it is below 100x100 you should not worry about it.

Also, any 'improvement' may be of the order of milliseconds, unless yoy are either working with extremely large matrices or repeating the operation thousands of times.

Finally, if you change the computer you are using for a faster one the differences will be even narrower!

Pablo Rodriguez's user avatar

  • 1 Yes I'm trying with 800X800 matrix, but the result between them is in the best case 1.4 times faster, not very significant. I think it depends on the cache memory. –  Peter Commented Dec 15, 2009 at 13:55
  • 1 800 x 800 is small, try something in the range 8000 x 8000 as well –  High Performance Mark Commented Dec 15, 2009 at 13:58

How big improvements you get will depend on:

  • The size of the cache
  • The size of a cache line
  • The degree of associativity of the cache

For small matrix sizes and modern processors it's highly probable that the data fron both MatrixA and MatrixB will be kept nearly entirely in the cache after you touch it the first time.

Andreas Brinck's user avatar

Just something for you to try (but this would only make a difference for large matrices): seperate out your addition logic from the multiplication logic in the inner loop like so:

This is because you end up stalling your pipeline when you write to suma. Granted, much of this is taken care of in register renaming and the like, but with my limited understanding of hardware, if I wanted to squeeze every ounce of performance out of the code, I would do this because now you don't have to stall the pipeline to wait for a write to suma. Since multiplication is more expensive than addition, you want to let the machine paralleliz it as much as possible, so saving your stalls for the addition means you spend less time waiting in the addition loop than you would in the multiplication loop.

This is just my logic. Others with more knowledge in the area may disagree.

  • 1 Comment 1: If your concerned about the instruction pipeline, consider unrolling the loops. Reducing the number of branches will speed up execution far more then separating multiplication from addition (some processors have single instructions that multiply and add). –  Thomas Matthews Commented Dec 15, 2009 at 19:33
  • Comment 2: Move the sums array and the suma variables outside the scope of the for loop. Also consider moving the index variables l and s too. When they are inside the outer for loop they will created and destroyed for every iteration of the outer for loop. Removing unnecessary instructions will also speed up execution. –  Thomas Matthews Commented Dec 15, 2009 at 19:36
  • 1 i was actually assuming the compiler would unroll the loops because that's pretty common, but i think it's rather unlikely that it will cache the multiplications separately for you, as it's difficult to determine the semantics of a reduction. Maybe i'm worng and every compiler does it. for your second comment, you are incorrect. the semantics in the code show that the memory is coming off of the stack, which means it is set aside at the beginning of the function, one time. –  user124493 Commented Dec 15, 2009 at 19:51
  • 1 Also, in regard to your first comment, I think you are missing the point. It's not atomicity of the mult we are concerned about, it's the time it takes to execute a mult. Modern processors can still take tens of times longer to do a mult than an add. So, if you stall the pipeline until you have a value to put into suma, you very well may be waiting 40 cycles+ longer each iteration of the loop than you need to, as opposed to only stalling once or twice (if you unroll the loop, or the compiler does). –  user124493 Commented Dec 16, 2009 at 0:31

Can you post some data comparing your 2 approaches for a range of matrix sizes ? It may be that your expectations are unrealistic and that your 2nd version is faster but you haven't done the measurements yet.

Don't forget, when measuring execution time, to include the time to transpose matrixB.

Something else you might want to try is comparing the performance of your code with that of the equivalent operation from your BLAS library. This may not answer your question directly, but it will give you a better idea of what you might expect from your code.

user229044's user avatar

The computation complexity of multiplication of two N*N matrix is O(N^3). The performance will be dramatically improved if you use O(N^2.73) algorithm which probably has been adopted by MATLAB. If you installed a MATLAB, try to multiply two 1024*1024 matrix. On my computer, MATLAB complete it in 0.7s, but the C\C++ implementation of the naive algorithm like yours takes 20s. If you really care about the performance, refer to lower-complex algorithms. I heard there exists O(N^2.4) algorithm, however it needs a very large matrix so that other manipulations can be neglected.

user2277473's user avatar

not so special but better :

user3089939's user avatar

Generally speaking, transposing B should end up being much faster than the naive implementation, but at the expense of wasting another NxN worth of memory. I just spent a week digging around matrix multiplication optimization, and so far the absolute hands-down winner is this:

This is even better than Drepper's method mentioned in an earlier comment, as it works optimally regardless of the cache properties of the underlying CPU. The trick lies in reordering the loops so that all three matrices are accessed in row-major order.

Mike Benden's user avatar

  • You are accessing B in column order, the inner loop is using j. –  greywolf82 Commented Feb 7, 2018 at 8:30

This is a very old question but I recently wandered down the rabbit hole and developed 9 different matrix multiplication implementations for both contiguous memory and non-contiguous memory (about 18 different functions). The results are interesting:

https://github.com/cubiclesoft/matrix-multiply

Blocking (aka loop tiling) didn't always produce the best results. In fact, I found that blocking may produce worse results than other algorithms depending on matrix size. And blocking really only started doing marginally better than other algorithms somewhere around 1200x1200 and performed worse at around 2000x2000 but got better again past that point. This seems to be a common problem with blocking - certain matrix sizes just don't work well. Also, blocking on contiguous memory performed slightly worse than the non-contiguous version. Contrary to common thinking, non-contiguous memory storage also generally outperformed contiguous memory storage. Blocking on contiguous memory also performed worse than an optimized straight pointer math version. I'm sure someone will point out areas of optimization that I missed/overlooked but the general conclusion is that blocking/loop tiling may: Do slightly better, do slightly worse (smaller matrices), or it may do much worse. Blocking adds a lot of complexity to the code for largely inconsequential gains and a non-smooth/wacky performance curve that's all over the place.

In my opinion, while it isn't the fastest implementation of the nine options I developed and tested, Implementation 6 has the best balance between code length, code readability, and performance:

Simply swapping j and k (Implementation 3) does a lot all on its own but little adjustments to use a temporary var for A and removing the if conditional notably improves performance over Implementation 3.

Here are the implementations (copied verbatim from the linked repository):

  • Implementation 1 - The classic naive implementation. Also the slowest. Good for showing the baseline worst case and validating the other implementations. Not so great for actual, real world usage.
  • Implementation 2 - Uses a temporary variable for matrix C which might end up using a CPU register to do the addition.
  • Implementation 3 - Swaps the j and k loops from Implementation 1. The result is a bit more CPU cache friendly but adds a comparison per loop and the temporary from Implementation 2 is lost.
  • Implementation 4 - The temporary variable makes a comeback but this time on one of the operands (matrix A) instead of the assignment.
  • Implementation 5 - Move the conditional outside the innermost for loop. Now we have two inner for-loops.
  • Implementation 6 - Remove conditional altogether. This implementation arguably offers the best balance between code length, code readability, and performance. That is, both contiguous and non-contiguous functions are short, easy to understand, and faster than the earlier implementations. It is good enough that the next three Implementations use it as their starting point.
  • Implementation 7 - Precalculate base row start for the contiguous memory implementation. The non-contiguous version remains identical to Implementation 6. However, the performance gains are negligible over Implementation 6.
  • Implementation 8 - Sacrifice a LOT of code readability to use simple pointer math. The result completely removes all array access multiplication. Variant of Implementation 6. The contiguous version performs better than Implementation 9. The non-contiguous version performs about the same as Implementation 6.
  • Implementation 9 - Return to the readable code of Implementation 6 to implement a blocking algorithm. Processing small blocks at a time allows larger arrays to stay in the CPU cache during inner loop processing for a small increase in performance at around 1200x1200 array sizes but also results in a wacky performance graph that shows it can actually perform far worse than other Implementations.

CubicleSoft's user avatar

If you are working on small numbers, then the improvement you are mentioning is negligible. Also, performance will vary depend on the Hardware on which you are running. But if you are working on numbers in millions, then it will effect. Coming to the program, can you paste the program you have written.

Roopesh Majeti's user avatar

  • What I'm doing is starting from a 1x1 matrix until 1000X1000, the bigest one is multiplied 1 time, and the smaller one a number proportional to the maximum (MxMxM / NxNxN, being M the bigest one). So i.e a 1x1 matrix will be multiplied 1250000 times, 2x2 578703 and so on. Then I divided the total time for the total iterations for that dimension –  Peter Commented Dec 15, 2009 at 14:13

Very old question, but heres my current implementation for my opengl projects:

Where N is replaced with the size of the matrix. So if you are multiplying 4x4 matrices, then you use:

This function mainly minimizes loops but the modulus might be taxing... On my computer this function performed roughly 50% faster than a triple for loop multiplication function.

Lots of code needed (ex. different functions for mat3 x mat3, mat5 x mat5...)

Tweaks needed for irregular multiplication (ex. mat3 x mat4).....

Jas's user avatar

  • 1 I think your generic pseudocode is not quite right. Should probably be i / N and i % N . Division by powers of two can be optimized with bit shifting ( i >> 2 ). Modulus of powers of two can be optimized with bitwise and ( i & 0x03 ). Another option could be to just unroll the loop for the entire operation for small matrices (4x4 and smaller). –  CubicleSoft Commented Dec 9, 2022 at 16:22

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged c matrix or ask your own question .

  • The Overflow Blog
  • Where does Postgres fit in a world of GenAI and vector databases?
  • Mobile Observability: monitoring performance through cracked screens, old...
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites
  • What does a new user need in a homepage experience on Stack Overflow?
  • Feedback requested: How do you use tag hover descriptions for curating and do...
  • Staging Ground Reviewer Motivation

Hot Network Questions

  • Stuck on Sokoban
  • Book or novel about an intelligent monolith from space that crashes into a mountain
  • What is the difference between a "Complaint for Civil Protection Order" and a "Motion for Civil Protection Order"?
  • Reference request: acceleration/curvature of curve in metric space
  • Who was the "Dutch author", "Bumstone Bumstone"?
  • What is opinion?
  • Is there a phrase for someone who's really bad at cooking?
  • Maximizing the common value of both sides of an equation
  • Reusing own code at work without losing licence
  • How do eradicated diseases make a comeback?
  • Weird SMS. Help!
  • Are the any polls on the opinion about Hamas in the broader Arab or Muslim world?
  • How did Oswald Mosley escape treason charges?
  • I'm trying to remember a novel about an asteroid threatening to destroy the earth. I remember seeing the phrase "SHIVA IS COMING" on the cover
  • The size of elementary particles
  • How can moral disagreements be resolved when the conflicting parties are guided by fundamentally different value systems?
  • Is there a way to resist spells or abilities with an AOE coming from my teammates, or exclude certain beings from the effect?
  • How to remove obligation to run as administrator in Windows?
  • Is it possible to have a planet that's gaslike in some areas and rocky in others?
  • What explanations can be offered for the extreme see-sawing in Montana's senate race polling?
  • Why is the movie titled "Sweet Smell of Success"?
  • My toilet has no working parts in the tank. I poured water into the bowl but it didn't work. Can it work without the tank?
  • My visit is for two weeks but my host bought insurance for two months is it okay
  • Too many \setmathfont leads to "Too many symbol fonts declared" error

matrix multiplication homework

  • Intro Physics Homework Help
  • Advanced Physics Homework Help
  • Precalculus Homework Help
  • Calculus Homework Help
  • Bio/Chem Homework Help
  • Engineering Homework Help

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

  • Homework Help
  • Precalculus Mathematics Homework Help

Master Matrix Multiplication: Solving Size Confusion | Homework Help

  • Thread starter DiamondV
  • Start date Mar 3, 2016
  • Tags Matrix Matrix multiplication Multiplication
  • Mar 3, 2016

Homework Statement

matrix multiplication homework

Homework Equations

The attempt at a solution.

  • Physics researchers identify new multiple Majorana zero modes in superconducting SnTe
  • Chiral molecule research achieves near-complete separation in quantum states
  • Researchers create entangled quantum magnets with protected quantum excitations

A PF Mountain

In order to do matrix multiplication, the number of columns of the first matrix must fit the number of rows of the second and this goes by definition. Then what specifies the dimensions of the new matrix, is the number of rows of the first and the number of columns of the second.  

A PF Universe

DiamondV said: Homework Statement Well, basically my issue isn't exactly with how to multiply matrices. I know how to do that, my issue is the way my lecturer shows how to find the size of the new matrix, this is all that he shows: I mean how is he getting AX to be a 3x1 matrix?
DiamondV said: Homework Equations The Attempt at a Solution

A PF Organism

This is the only definition of matrix multiplication I have ever been aware of, so I am not sure what you mean that you know how to multiply matrices. Here is a website with arrows and pictures. https://www.mathsisfun.com/algebra/matrix-multiplying.html Recommend: move to precalculus forum.  

RUber said: Recommend: move to precalculus forum.

Related to Master Matrix Multiplication: Solving Size Confusion | Homework Help

What is matrix multiplication.

Matrix multiplication is a mathematical operation that involves multiplying two matrices to create a new matrix. It is an important concept in linear algebra and is used in various fields of science and engineering.

How do you multiply matrices?

To multiply two matrices, the number of columns in the first matrix must be equal to the number of rows in the second matrix. Then, multiply each element in the first row of the first matrix by each element in the first column of the second matrix. Repeat this process for each row and column combination, and add the products to get the corresponding element in the resulting matrix.

Why is matrix multiplication important?

Matrix multiplication is important because it allows us to perform operations on complex systems and data sets. It is used in computer graphics, machine learning, physics, and many other areas of science and engineering.

What is the difference between matrix multiplication and scalar multiplication?

The main difference between matrix multiplication and scalar multiplication is the number of operands involved. Matrix multiplication involves two matrices, while scalar multiplication involves a single matrix and a single number (scalar). Additionally, matrix multiplication follows a specific set of rules, while scalar multiplication is simply multiplying each element in the matrix by the scalar.

What are some real-world applications of matrix multiplication?

Matrix multiplication has many real-world applications, such as image and signal processing, data encryption, and network analysis. It is also used in finance for portfolio optimization and in economics for modeling supply and demand systems. Additionally, matrix multiplication is used in engineering for solving systems of linear equations and in physics for calculating the effects of transformations and rotations.

Similar threads

  • Jun 4, 2024
  • Sep 5, 2017
  • Jun 13, 2018
  • Jan 17, 2017
  • Feb 9, 2016
  • Mar 9, 2016
  • Sep 8, 2017
  • Jun 30, 2016
  • Apr 22, 2016
  • Apr 3, 2016

Hot Threads

  • Finding the domain (and range) of a logarithmic function
  • Work out the amount that Arjun paid in rent in 2019
  • A combinatorial probability question
  • Equal intercept on the three axes
  • Conjugate vs Complex Conjugate

Recent Insights

  • Insights   Brownian Motions and Quantifying Randomness in Physical Systems
  • Insights   PBS Video Comment: “What If Physics IS NOT Describing Reality”
  • Insights   Aspects Behind the Concept of Dimension in Various Fields
  • Insights   Views On Complex Numbers
  • Insights   Addition of Velocities (Velocity Composition) in Special Relativity
  • Insights   Schrödinger’s Cat and the Qbit
  • MATLAB Answers
  • File Exchange
  • AI Chat Playground
  • Discussions
  • Communities
  • Treasure Hunt
  • Community Advisors
  • Virtual Badges
  • Trial software

You are now following this question

  • You will see updates in your followed content feed .
  • You may receive emails, depending on your communication preferences .

How to multiply matrices using for loops?

Stefan

Direct link to this question

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops

   0 Comments Show -2 older comments Hide -2 older comments

Sign in to comment.

Sign in to answer this question.

Accepted Answer

Image Analyst

Direct link to this answer

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#answer_151685

   5 Comments Show 3 older comments Hide 3 older comments

Stefan

Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#comment_237045

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#comment_398941

Image Analyst

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#comment_398959

Sunil Kunjachan

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#comment_414453

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#comment_414455

More Answers (1)

Kan Sun

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#answer_357434

   1 Comment Show -1 older comments Hide -1 older comments

Aditya Sur

https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops#comment_2022544

  • matrix multiplication

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

  • América Latina (Español)
  • Canada (English)
  • United States (English)
  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 简体中文 Chinese
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Contact your local office

  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Printer Friendly Page
  • All Forum Topics
  • Previous Topic

matrix multiplication

interestedtolearn

‎04-08-2021 11:51 AM

  • Mark as New
  • Report to a Moderator

Solved! Go to Solution.

Re: matrix multiplication

altenbach

‎04-08-2021 11:54 AM

‎04-08-2021 12:14 PM - edited ‎04-08-2021 12:15 PM

‎04-08-2021 12:18 PM - edited ‎04-08-2021 12:47 PM

altenbach_0-1617902855120.png

‎04-08-2021 12:34 PM

‎04-08-2021 12:46 PM

altenbach_0-1617903937326.png

‎04-08-2021 12:50 PM - edited ‎04-08-2021 12:52 PM

BertMcMahan

‎04-08-2021 12:54 PM

:winking_face:

‎04-08-2021 01:12 PM

:grinning_face_with_smiling_eyes:

‎04-08-2021 01:20 PM

:face_with_tongue:

What do you need our team of experts to assist you with?

We'll be in touch soon!

COMMENTS

  1. Matrix Addition and Multiplication

    The answer is a 2 \times 2 2× 2 matrix. The multiplication is divided into 4 steps. Step 1: Multiply the 1st row of the first matrix and 1st column of the second matrix, element by element. The result goes in the position (1, 1) Step 2: Now, multiply the 1st row of the first matrix and 2nd column of the second matrix.

  2. PDF 1.2 Matrix Multiplication

    1.2 Matrix Multiplication In this section we look at various ways of viewing matrix multiplication. These different points of view are useful to quickly see why certain formulas that arise later are valid. If a = (a 1, a 2, …, a n) is a row vector and x = x 1 x 2. x n is a column vector then ax is the sum of the products of

  3. PDF Chapter 4: Matrices

    described using matrix multiplication. Each reflection and each rotation has a unique 2-by-2 matrix. When the matrix of the coordinates for a figure is multiplied by such a matrix, the resulting matrix gives the coor-dinates of the reflected or rotated figure. Determinants Students learn how to find the determinant of a 2-by-2 and a 3-by-3 matrix.

  4. PDF Multiplying Matrices

    Matrix multiplication is useful in business applications because an inventory matrix, when multiplied by a cost per item matrix, results in a total cost matrix. • = ... HOMEWORK HELP Example 1: Exs. 11-16 Examples 2, 3: Exs. 17-26 Example 4: Exs. 27-32 Example 5: Exs. 35-40. Page 1 of 2

  5. Solve Matrix Multiplication Homework Statement

    To solve matrix multiplication homework problems, you need to follow a specific set of steps. First, make sure the matrices are compatible for multiplication (the number of columns in the first matrix must be equal to the number of rows in the second matrix). Then, multiply the corresponding elements in each row of the first matrix by the ...

  6. Matrix Multiplication Calculator

    Here you can use Matrix Multiplication Calculator to calculate the complex matrix numbers online for free. A matrix is an array of numbers organized in rows and columns. ... This interactive tool can be used in class or as homework assignment and offers different approaches for students to complete the task, such as using grids or tables ...

  7. Matrix Multiplication

    An interactive matrix multiplication calculator for educational purposes. Matrix Multiplication-+-+

  8. Prove: A(BC)=(AB)C for matrix multiplication

    Then we multiply A and the resulting matrix, giving us a final matrix with dimensions 2x2. When we multiply them in the order (AB)C, we first multiply A and B, giving us a 2x4 matrix. Then we multiply this matrix with C, resulting in a final matrix with dimensions 2x2. As you can see, the result is the same regardless of the order in which we ...

  9. Matrix Multiplication Homework: Equations and Solutions"

    Related to Matrix Multiplication Homework: Equations and Solutions" 1. What is matrix multiplication? Matrix multiplication is a mathematical operation that involves multiplying two matrices to produce a new matrix. It is used to transform data and solve systems of equations in various fields such as physics, engineering, and computer science.

  10. Multiplication of Matrices Worksheets

    Answer Key. Answers for the lesson and practice sheets. View worksheet. Answer: The puzzle told us the length of Diophantus' life (84 years). Let the length of his life be called x. 1/6 x + 1/12 x + 1/7 x + 5 + 1/2 x + 4 = x. Multiplication of Matrices Worksheets- Includes math lessons, 2 practice sheets, homework sheet, and a quiz!

  11. MULTIPLYING MATRICES

    Matrix Operations and Multiplication 619 plays 8th - 11th 20 Qs . Matrices 495 plays 10th - 12th SUPER. 10 Qs . Numeros 1.7K plays KG SUPER. 11 Qs . Prepositions 165 plays KG 20 Qs . Determinants and Inverses of Matrices 477 plays 11th - 12th 10 Qs . Multiplying Matrices 633 plays 12th LESSON. 18 Qs .

  12. Using only the definition of matrix multiplication, prove that

    Matrix rings are not fields since regular matrix multiplication is not commutative. Explain this statement. Prove that if A is an m times n matrix, x and y are n times 1 matrices, and k epsilon R, then A(x + y) = Ax + Ay. (Hint: linear combination) Is square matrix multiplication commutative? Determine whether or not matrix multiplication is ...

  13. Matrix Multiplication

    Matrix Multiplication. Using a Matrix for 2-Digit Multiplication. Comparing Fractions. Homework Zone: Math - Comparing Fractions. Measurement. Metric Measurements. Weight - Measurement in units. Probability. Probability - Percentage of chance. All about the Numerator. Understanding Fractions.

  14. 311. Sparse Matrix Multiplication

    A sparse matrix is a matrix that is comprised mostly of zero values. The input consists of two matrices mat1 and mat2 where mat1 is of size m x k and mat2 is of size k x n. The task is to compute the matrix product of mat1 and mat2 and return the resulting matrix. It's assumed that the multiplication of the given matrices is always valid, which ...

  15. Matrix Multiplication

    A lesson on matrix multiplication. Skip to main content. View video transcript. Matrix Multiplication. Using a matrix to mulitply 2-digit by 1-digit numbers to help with mental math. ... Homework Zone: Language - Paragraph with Supporting Details. Dave the Dino Expert Ep 3. Dave the Dino Expert: EP 1. Dave the Dino Expert Ep 2.

  16. PfHP Matrix-vector multiplication via axpy operations

    What it also demonstrates is how matrix-vector multiplication can be implemented as a sequence of axpy operations. Homework 1.3.5.2.. In directory Assignments/Week1/C complete the implementation of matrix-vector multiplication in terms of axpy operations

  17. Optimized matrix multiplication in C

    Getting this right is non-trivial. Using an existing BLAS library is highly recommended. Should you really be inclined to roll your own matrix multiplication, loop tiling is an optimization that is of particular importance for large matrices. The tiling should be tuned to the cache size to ensure that the cache is not being continually thrashed, which will occur with a naive implementation.

  18. Master Matrix Multiplication: Solving Size Confusion

    In order to do matrix multiplication, the number of columns of the first matrix must fit the number of rows of the second and this goes by definition. Then what specifies the dimensions of the new matrix, is the number of rows of the first and the number of columns of the second. Mar 3, 2016. #3. Mark44.

  19. Uses of matrix multiplication.

    It is called a square matrix if it's number of rows and columns are equal. One operation that can be applied in matrices is multiplication. The multiplication of two matrices is valid only if the number of columns of a first matrix is equal to number of rows of a second matrix. The matrix multiplication is not necessarily commutative.

  20. How to multiply matrices using for loops?

    Learn more about for loop, matrices, matrix multiplication, homework I have a problem in which I have to multiply two matrices, x (700x900) and y(900,1100), using a for loop. I'm not sure where to start, I've only been using MATLAB for about a month.

  21. Solved: matrix multiplication

    matrix multiplication. 04-08-2021 11:51 AM. I have been set the challenge of multiplying 2 matrices (3x3) together without using the AxB block in linear algebra. I have transposed the second matrix to make it so i only have to multiply and add on rows. I am able to either get all the diagonals or the only the first row, and im struggling with ...

  22. Is square matrix multiplication commutative?

    Commutativity: For arithmetic, commutativity implies that for two numbers, a and b, ab = ba. For linear algebra, if two square matrices, A and B, are commutative, this implies AB = BA. This could only occur for square matrices: if A is a 3x5 matrix and B is a 5x4 matrix, then AB is a 3x4 matrix and BA does not exist.

  23. PDF CS 6210: Homework 1

    Matrix factorizations and norms will play a key role in our analysis of algorithms. (a)Prove that for any induced matrix norm ∥·∥and A∈Rn×n ρ(A) ≤∥A∥, where ρ(A) is the spectral radius of A(i.e., the magnitude of the largest eigenvalue). (b)A matrix A∈Cn×n is called normal if A∗A= AA∗.Prove that if Ais normal, then the

  24. PDF Welcome to Introduction to Robotics

    •Homework Parties on Fridays 3-5pm in 2013 ECEB •Remember to be kind to your TAs. Slides usually go here. Course Components -25% Homework ... Common Matrix Operations-Multiplication by a scalar-Sum (commutative, associative)-Multiplication by a vector-Product (not commutative)-Transposition