Articles tagged with Array
- Make Sum Divisible by P - Two Sum logic on prefix mod, published 2024-10-06
- Greatest Common Divisor Traversal - Prime graph connectivity, published 2024-02-25
- Cherry Pickup II - Clear concise 2D DP, published 2024-02-11
- Maximum Good Subarray Sum - Prefix Sum + HashMap, published 2024-02-05
- Partition Array for Maximum Sum - Top down and bottom up DP, published 2024-02-03
- Number of Submatrices That Sum to Target - Subarray target sum properly explained, published 2024-01-28
- Insert Delete GetRandom O(1) - Swap with last element, published 2024-01-16
- Minimum Difficulty of a Job Schedule - Simple concise code for top-down DP with intuition, published 2023-12-30
- Minimum Cost to Make Array Equalindromic - Check one palindrome on each side of median, published 2023-12-18
- Count of Smaller Numbers After Self - MergeSort based concise solution, published 2023-12-08
- Largest Submatrix With Rearrangements - Permute histogram bars to maximize area, published 2023-11-26
- Diagonal Traverse II - Short and clean five lines of code using TreeMap, published 2023-11-22
- Bus Routes - BFS solution with intuition, published 2023-11-12
- Restore the Array From Adjacent Pairs - Create graph and run DFS, published 2023-11-10
- Binary Trees With Factors - DP on sorted array, published 2023-10-26
- Constrained Subsequence Sum - Sliding window DP with heap, published 2023-10-21
- Parallel Courses III - Process in topological order, published 2023-10-20
- Maximum Number of Jumps to Reach the Last Index - DP based solution, published 2023-07-10
- Special Permutations - DP with bitmask, published 2023-06-20
- Movement of Robots - Collision means nothing, published 2023-06-15
- Unique Paths II - Top down and bottom up DP, published 2023-06-09
- N-Queens - Backtracking intuition, published 2023-06-09
- Extra Characters in a String - Top-down and Bottom-up DP, published 2023-05-29
- Power of Heroes - One pass solution with detailed explanation, published 2023-05-20
- Evaluate Division - DFS + BFS + DSU solutions, published 2023-05-20
- Combination Sum IV - DFS Recursive Memoization, published 2023-05-20
- Combination Sum - DFS Recursion, published 2023-05-18
- Combination Sum III - DFS Recursion, published 2023-05-18
- Combination Sum II - DFS Recursion, published 2023-05-18
- Maximum Number of Moves in a Grid - DFS + BFS + DP solutions, published 2023-05-17
- Neighboring Bitwise XOR - Simple O(n) solution, published 2023-05-15
- Solving Questions With Brainpower - Top-down and bottom-up DP with intuition, published 2023-05-12
- Range Sum Query - Mutable - Segment tree in C++ and Java, published 2023-05-01
- Checking Existence of Edge Length Limited Paths - Union-Find with sorted edges and queries, published 2023-04-29
- Similar String Groups - DFS + BFS + Union-Find solutions, published 2023-04-28
- Minimize the Total Price of the Trips - DFS + DP solution with explanation, published 2023-04-27
- Profitable Schemes - Memoization step by step, published 2023-04-24
- Reduction Operations to Make the Array Elements Equal - Sort and count using hashmap [Short + Easy], published 2023-04-19
- Maximum Value of K Coins From Piles - Bottom-up DP explained, published 2023-04-15
- Design Browser History - Simple array solution [Easy + Short], published 2023-03-18
- Construct Quad Tree - 3 ways to do recursion, flyweight pattern, published 2023-02-27
- Capacity To Ship Packages Within D Days - Binary search with proper explanation, published 2023-02-22
- 4Sum - K Sum solution explained, published 2023-02-22
- Put Marbles in Bags - 2 Heap solution with explaination, published 2023-02-17
- Substring XOR Queries - Clean HashMap solution, published 2023-02-13
- As Far from Land as Possible - Multi Source BFS, published 2023-02-10
- Naming a Company - HashSet for all letters, published 2023-02-09
- Subarrays with K Different Integers - Sliding window + HashMap, published 2023-02-07
- Fruit Into Baskets - Reaching the best solution, published 2023-02-07
- Word Break II - Word Break extension (DP), published 2023-01-27
- Concatenated Words - Word Break extension (DP), published 2023-01-27
- Increment Submatrices by One - Cumulative Sum, published 2023-01-15
- Sum of Subarray Minimums - Monotonic Stack + DP, published 2023-01-06
- Daily Temperatures - Monotonic stack, published 2022-12-20
- Paths in Matrix Whose Sum Is Divisible by K - 3D DP table, published 2022-11-30
- Maximum Profit in Job Scheduling - [Explained + Example] DP (Knapsack)+ OOP Faster than 97%, published 2022-11-26
- Word Search II - [Explained] Trie + DFS Clean C++ code, published 2022-11-16
- Where Will the Ball Fall - Just play the game!, published 2022-11-01
- Rotting Oranges - Easy BFS, published 2022-10-25
- Minimum Path Sum - Easy O(m*n), published 2022-10-25
- Find Minimum in Rotated Sorted Array - Iterative binary search, published 2022-10-25
- Word Break - Easy Concise DP, published 2022-10-21
- Wiggle Sort II - Trial and Error, published 2022-10-21
- Insert Delete GetRandom O(1) - Simple Hashset, published 2022-10-21
- Contains Duplicate II - Hashset, published 2022-10-21
- Search a 2D Matrix II - Top right to bottom left, published 2022-10-18
- Surrounded Regions - Island method [DFS], published 2022-10-17
- Number of Islands - Easy DFS, published 2022-10-17
- Count Primes - Sieve of Eratosthenes with Exaplanation, published 2022-10-15
- Word Search - Help needed for DFS solution, published 2022-10-13
- Plus One - Simple c++ solution with explanation, published 2022-10-06
- Spiral Matrix - Spiral traversal, published 2022-10-04
- Search in Rotated Sorted Array - Faster than 100% -- Rotation pivot using binary search, published 2022-10-04
- Longest Increasing Subsequence - Two DP solutions, published 2022-10-04
- Largest Divisible Subset - DP faster than 95%, published 2022-10-04
- Group Anagrams - Easy hashmap, published 2022-10-04
- Minimum Time to Make Rope Colorful - Easy approach O(N) solution based on RLE, published 2022-10-03
- Two Sum II - Input Array Is Sorted - Three solutions, published 2022-09-27
- Count Sub Islands - DFS solution, published 2022-09-27
- 3Sum - Two pointers + Hashmap, published 2022-09-27
- 3Sum Closest - Two pointers in sorted array, published 2022-09-27
- Non-overlapping Intervals - Greedy cpp+python, published 2022-06-17
- Longest String Chain - Very Easy Hashmap solution + Analysis, published 2022-06-15
- Next Greater Element II - NGE using stack on repeated array, published 2022-06-04
- Next Greater Element I - Stack + HashMap O(N1+N2) solution, published 2022-06-02
- Combination Sum III - DFS and All combinations, published 2022-05-10
- 132 Pattern - O(N^3), O(N^2), O(N log N) and O(N) solutions, published 2022-05-10
- Max Number of K-Sum Pairs - Two Sum Approach, published 2022-05-04
- 3Sum With Multiplicity - 3 Sum over keys, published 2022-04-23
- Design HashSet - Hashing using modulo, published 2022-04-21
- Design HashMap - Hashing using modulo, published 2022-04-21
- Game of Life - O(1) space solution, published 2022-04-20
- Spiral Matrix II - Two approaches, published 2022-04-19
- Trapping Rain Water - Easy method, published 2022-04-16
- Delete and Earn - House Robber, published 2022-03-05
- Arithmetic Slices - Faster than 100% C++ solutions and also very easy to understand, published 2022-03-03
- Subsets - Simple Iterative solution, published 2022-02-13
- Subarray Sum Equals K - O(N) HashMap cummulative sum, published 2022-02-11
- Valid Triangle Number - O(N^2) log(N) Binary Search [AC], published 2022-02-09
- Minimum Falling Path Sum - DP Solution very straightforward | Seam Carving, published 2022-02-06
- Contiguous Array - Well-explained HashMap concise with pseudocode, published 2022-02-04
- Max Area of Island - DFS solution, published 2022-02-03
- 4Sum - C++ TLE vs Python AC issue, published 2022-02-03
- 4Sum II - Easy O(N^2) solution using HashMap, published 2022-02-03
- Next Permutation - Well-explained O(n) easy to understand in C++, published 2022-02-01
- Maximum Good People Based on Statements - [C++,Java,Python] Detailed easy to understand bitmask, published 2022-01-25
- Construct Binary Tree from Preorder and Inorder Traversal - Two easy to understand recursive solutions, published 2022-01-06
- Find All Possible Recipes from Given Supplies - Two ways to do topological sort, published 2021-12-29