44. Wildcard Matching
Wildcard Matching
Wildcard Matching
Multiply Strings
Valid Sudoku
Sudoku Solver
Longest Valid Parantheses
Substring With Concatenation Of All Words
Divide Two Integers
Find The Index Of The First Occurence In A String
Smallest Divisible Digit Product 1
Remove Duplicates From Sorted Array
Remove Element
Reverse Nodes In K Group
Reverse Linked List
Merge 2 Sorted Lists
Generate Parantheses
Longest Common Prefix
3 Sum
Integer To Roman
Roman To Integer
String To Integer (atoi)
Palindrome Number
Zigzag Conversion
Median Of Two Sorted Arrays
Add 2 Numbers
Maximise Active Section With Trade 1
Recover Tree From Preorder Traversal
Shift 2d Grid
Smallest Subsequence Of Distinct Characters
Concatenate Non Zero Digits And Multiply By Sum 2
Rank Transform Of An Array
Path Existence Queries In A Graph 1
Remove Covered Intervals
Number Of Paths With Max Score
Network Recovery Pathways
Minimum Score Of A Path Between 2 Cities
Find The Safest Path In A Grid
Find A Safe Walk Through A Grid
Number Of Strings That Appear As Substring In Word
Count Subarrays With Majority Element 2
Find The Maximum Number Of Elements In A Subset
Number of Zig-Zag Arrays 1
Process String With Special Operations 2
Maximum Ice Cream Bars
Max Number Of Balloons
Angle Between Hands Of A Clock
Find The Highest Altitude
Process String With Special Operations 1
Delete The Middle Node Of A Linked List
Number Of Ways To Assign Edge Weights 1
Weighted Word Mapping
Create Binary Tree From Descriptions
Left And Right Sum Differences
Total Waviness Of Numbers In Range 1
Minimum Cost Of Buying Candies With Discount
Earliest Finish Time For Land And Water Rides 2
Maximum Number Of Items From Sale 1
Destroying Asteroids
Minimum Element After Replacing With Digit Sum
Longest Common Suffix Queries
Count The Number Of Special Characters 2
Jump Game 7
Count The Number Of Special Characters 1
Jump Game 5
Minimum Moves To Make Array Complementary
Find The Length Of The Longest Common Prefix
Maximum Walls Destroyed By Robots
Jump Game 4
Jump Game 3
Find Minimum In Rotated Sorted Array
Minimum Initial Energy To Finish Tasks
Maximum Number Of Jumps To Reach The Last Index
Minimum Jumps To Reach End Via Prime
Jump Game 9
Robot Collisions
Maximum Size Of Set After Removals
Rotate List
Rotate Image
Rotate String
Lexicographically Smallest Generated String
Rotated Digits
Rotate Function
Minimum Distance To Type A Word Using 2 Different Fingers
Find The String With LCP
Maximise Amount After 2 Days Of Conversions
Maximise The Distance Between Points On A Square
Minimum Operations To Make Array Non Decreasing
Check If There Is A Valid Path In The Grid
Detect Cycles In 2d Grid
Longest Balanced String After One Swap
Sum Of Distances
Furthest Point From Origin
Minimize Hamming Distance After Swap Operations
Words Within 2 Edits Of Dictionary
Maximum Distance Between A Pair Of Values
2 Farthest Houses With Different Colors
Adding Spaces To A String
Multi Source Flood Fill
Minimum Moves To Spread Stones Over Grid
Minimum Absolute Distance Between Mirror Pairs
Closest Equal Element Queries
Can Place Flowers
Maximise Spanning Tree Stability With Upgrades
Maximum Swap
Equal Sum Grid Partition 2
Minimum Increase To Maximise Special Indices
Minimum Distance Between 3 Equal Elements
Incremental Even Weighted Cycle Queries
Possible Bipartition
Mirror Frequency Text
Integers With Multiple Sum Of Two Cubes
Decode Slanted Ciphertext
Directions Assignments With Exactly K Visible People
Maximum Amount Of Money Robot Can Earn
Cousins In A Binary Tree 2
Cousins In A Binary Tree 1
Count Number Of Nice Subarrays
Check If Strings Can Be Made Equal With Operations 2
Check If Strings Can Be Made Equal With Operations 1
Equal Sum Grid Partition 1
Minimum Absolute Difference Between 2 Values
Minimum Xor Path In A Grid
Design Event Manager
Matrix Similarity After Cyclic Shifts
Minimum Absolute Difference In A Sliding Matrix
Construct Product Matrix
Maximum Non Negative Product In A Matrix
Check Whether Matrix Can Be Obtained By Rotation
Largest Submatrix With Rearrangements
Count Submatrices With Top Element And Sum Less Than K
Count Submatrices With Equal Frequency Of X And Y
Greatest Common Divisor Of Strings
Walking Robot Simulation
Minimized Maximum Of Products Distributed To Any Store
Sequential Digits
Minimum Changes To Make Alternating Binary String
Binary Subarrays With Sum
Special Positions In A Binary Matrix
Find Nth Bit In Kth Binary String
Minimum Swaps To Arrange A Binary Grid
Minimum Operations To Equalize Binary String
Partitioning Into Maximum Number Of Deci Binary Numbers
Merge Close Characters
Check If A String Contains All Binary Strings Of Size K
Special Binary String
Count Binary Substrings
Champagne Tower
Longest Balanced Subarray 1
Longest Balanced Subarray 1
Balance A Binary Search Tree
Minimum Deletions To Make String Balanced
Minimum Number Of Removals To Balance An Array
Trionic Array 1
Divide An Array Into Subarrays With Minimum Cost 1
Minimum Cost To Convert String 1
Rotate Non Negative Elements
Minimum Cost Path With Edge Reversals
Minimize Maximum Pair Sum In An Array
Maximum Side Length Of A Square With Sum Less Than Or Equal To Threshold
Largest Magic Square
Find The Largest Area Of Square Inside Rectangles
Maximum Square Area By Removing Fences From A Field
Maximize Area Of Square Hole In Grid
Separate Squares 1
Minimum Time Visiting All Points
Minimum Ascii Delete Sum For 2 Strings
Max Dot Product Of 2 Subsequences
Maximum Product Of Split Binary Tree
Maximum Matrix Sum
Number Of Increasing Paths In A Grid
4 Divisors
Number Of Ways To Paint Nx3 Grid
Last Day When You Can Still Cross
Pyramid Transition Matrix
Amazon’s - 926. Flip String Monotone Increasing
Next Permutation
Meeting Rooms 3
Minimum Penalty For A Shop
Job Sequencing Problem
Maximise Happiness Of Selected Children
Minimum Cost To Cut A Stick
Two Best Non Overlapping Events
Apple Redistribution Into Boxes
Delete Columns To Make Sorted 3
Delete Columns To Make Sorted 2
Delete Columns To Make Sorted
Number Of Smooth Decent Periods Of A Stock
Number Of Ways To Divide A Long Corridor
Permutations 2
IPO
Count Covered Buildings
Count Special Triplets
Count Number Of Odd Numbers In An Interval Range
Count Number Of Collissions On A Road
Amount Of Time For Binary Tree To Be Infected
Make Sum Divisible By P
Maximum Number Of K Divisible Components
Maximum Subarray Sum With Length Divisible By K
Subarray Sums Divisible By K
Paths In A Matrix Divisible By 5
Smallest Integer Divisible By K
Binary Prefix Divisible By 5
Greatest Sum Divisible By 3
Unique Length 3 Palindromic Subsequences
Set Intersection Size Of Atleast 2
1 Bit And 2 Bit Characters
Number Of Substrings With Only Ones
Count The Number Of Substrings With Dominant Ones
Increment Submatrices By One
Maximum Number Of Operations To Move Ones To End
Minimum Number Of Operations To Convert All Elements To Zero
Minimum Number Of Operations To Make Array Elements Equal To 1
Ones And Zeroes
Maximize The Minimum Powered City
Power Grid Maintenance
Find X Sum Of All K Long Subarrays 2
Find X Sum Of All K Long Subarrays 1
Minimum Time To Make Rope Colorful
Count Unguarded Cells In The Grid
Delete Nodes From Linked List Present In Array
All Nodes Distance K In Binary Tree
Minimum Number of Increments To Reach Target Subarray
Smallest Number With All Set Bits
Make Array Elements Zero
Number Of Laser Beams In A Bank
Next Greater Numericaly Balanced Number
Maximum Frequency Of An Element After Performing Operations 2
Lexicographically Smallest String After Applying Operations
Maximum Number Of Distinct Elements After Operations
Smallest Non Negative Number After Operations
Adjacent Increasing Subarrays Detection 2
Adjacent Increasing Subarrays Detection 1
Design Movie Rental System
Max Energy From Mystic Dungeon
Minimum Amount Of Time To Brew Potions
Successful Pairs Of Spells And Potions
Avoid Flood In The City
Swim In Rising Water
Trapping Rain Water 2
Num Bottles 2
Find Triangular Sum Of Array
Minimum Score Triangulation Of Polygon
Largest Perimeter Triangle
Valid Triangle Number
Fraction To Decimal
Implement Router
Compare Version Numbers
Count Elements With Maximum Frequency
Design A Food Rating System
Remove Coprimes From Array
Vowels Game In String
Sort Vowels In String
Min Number Of People To Teach
Find N Unique Integers Sum Up To Zero
Minimum Operations To Make Integer Zero
Max Average Pass Ratio
Number Of Ways To Place People 1
Alice And Bob Playing Flower Game
Sort Matrix By Diagonals
Diagonal Traverse
Min Area To Cover All 1s
Power Of 2
Fruit Into Baskets
Longest Subarray With Maximum Bitwise And
Bitwise Ors Of Subarrays
Count Max Number Of Bitwise Or Subsets
Count Hills And Valleys In An Array
Max Score From Removing Substrings
Maxiumum Erasure Value
Remove Subfolders From The File System
Find Maximum Length Of Subsequence 1
Longest Binary Sequence Less Than K
Lexicographically Minimum String After Removing Stars
Min Swaps To Sort By Digit Sum
Longest Unequal Adjacent Groups Subsequence 1
Finding 3-Digit Even Numbers
Max Total Damage With Spell Casting
Minimum Domino Rotations For Equal Row
Microsoft’s - 838. Push Dominoes
Count Subarrays Where Max Element Appears Atleast K Times
Count Subarrays Of Length Three With Condition
Find The Most Common Response
Unit Conversion 1
Count Complete Subarrays In An Array
Count Largest Group
Longest Subarray After Deleting One Element
Max Consecutive Ones 3
Minimize Difference Between Target And Chosen Elements
Frequency Of Most Frequent Element
Count And Say
Maximal Rectangle
Sum Of Subarray Sums
Lca Of Deepest Leaves
Max Value Of An Ordered Triplet 2
Unique 3 Digit Even Numbers
Design Spreadsheet
Max Value Of An Ordered Triplet
Next Greater Node In Linked List
Remove Nodes From Linked List
Google’s - 1673. Find The Most Competitive Subsequence
Put Marbles In Bags
Microsoft’s - 316. Remove Duplicate Letters
Swap Nodes In Pairs
Substring Matching Pattern
Apply Operations To Maximise Score
Max Number Of Points From Grid Queries
3 Sum Closest Sum
Min Operations To Make Uni Value Grid
Random Pick With Weight
Simple Bank System
Zero Array Transformation 1
Number Of Substrings Containing All 3 Characters
Count Of Substrings Containing Every Vowel And K Consonants 2
Subarrays With K Different Integers
Partition Array According To Given Plot
Meta’s - 1582. Min Cost To Connect All Nodes
Meta’s - 1584. Min Cost To Connect All Nodes
Number Of Subarrays With Odd Sum
Max Absolute Sum Of Any Subarray
Eliminate Max Number Of Monsters
First Missing Positive
Google’s - 1161. Max Level Sum Of Binary Tree
Kth Lexicographical String Of All Happy Strings Of Length N
Count Square Submatrices With All Ones
Minimum Number Of Flips To Make Binary String Alternating
Reverse Integer
4 Sum
Matchsticks To Square
Min Difference Between Highest And Lowest Of K Scores
Check If Array Is Sorted And Rotated
Microsoft’s - 2477. Minimum Fuel Cost To Report To The Capital
Is Graph Bipartite
Out Of Boundary Paths
Permutations
Path With Max Probability
Network Delay Time
Reverse Words In String
Valid Paranthesis
Insert Intervals
Balanced Binary Tree
Find The Common Array Of 2 Arrays
Pacific Atlantic Flow
Pow X
Search In Rotated Sorted Array
Meta’s - 51. N Queens
Gas Stations
Jump Game 2
Find First And Last Element In Sorted Array
Insert Search Position
Combination Sum 2
Letter Combinations Of A Phone Number
Remove Nth Node From Linked List
Group Anagrams
Triangle
Happy Number
Palindromic Substrings
Google’s - 5. Longest Palindromic Substring
Amazon’s - 279. Perfect Squares
Longest Consecutive Sequence
Microsoft’s - 295. Find Median Of Data Stream
Lexicographical Numbers
Min Window Substring
Amazon’s - Max Product Subarray
Meta’s - Daily Temps
Prefix And Suffix Search
Meta’s - Set Matrix Zeroes
Amazon’s - Next Greater Element 1
Amazon’s - Next Greater Element 2
Meta’s - Search Words 2
Google’s - Sliding Window Maximum
Meta’s - Repeated DNA Sequences
Google’s - Design Add And Search Word Data Structure
Microsoft’s - Implement Trie
Google’s - Palindrome Partitioning
Google’s - Best Time To Buy And Sell Stock
Meta’s - Isomorphic Strings
K Diff Pairs In An Array
Max Enemy Forts That Can Be Captured
Boats To Save People
Amazon’s - Linked List Cycle Detection
Linked List Cycle 2
Google’s - Max Twin Sum Of Linked List
Amazon’s - Find Duplicate Number
Microsoft’s - Middle Of Linked List
Amazon’s - Subarray Sum Equals K
Microsoft’s - Find Pivot Index
Amazon’s - Range Query 2D
Amazon’s - Range Sum Query
Google’s - Trapping Rain
Microsoft’s - Remove Duplicates From Sorted Array
Google and Meta’s - Container With Most Water
Spotify’s - Valid Palindrome
Amazon’s - 2 Sum 2
Google’s - Longest Repeating Substring With Replacement
Amazon’s - Minimum Size Subarray
Fair Distribution Of Cookies
Amazon’s - Number Of Sub Arrays Of Size K And Average Greater Than Or Equal To Threshold
Meta’s - Contains Duplicates 2
Amazon’s - Longest Turbulent Subarray
Sum Of Power Of All Subsequences
Microsoft’s - Max Circular Subarray
Amazon’s - Max Subarray
Google’s - Longest Common Subsequence
Amazon’s - Min Stack
Amazon’s - Reverse Bits
Problem Statement in English Approach This is a subset of this problem. Solution in Python class Solution: def hammingWeight(self, n: int) -> int: ans = 0 while n > 0: if n&1 > 0: ans+=1 n = n >> 1 return ans Complexity Time: $O(1)$ Since we only process $32$ bits at most. Space: $O(1)$ Since we only store an integer variable. And we are done.
Amazon’s - Counting Bits
Meta’s - Sort Colors
Google’s - Unique Paths
Google’s - Unique Paths 2
Google’s - House Robber
Google’s - Course Schedule
Google’s - Clone Graph
Amazon’s - Shortest Path In Binary Matrix
Amazon’s - Rotting Oranges
Google’s - Number of Islands
Amazon’s - Product Of Array Except Self
Meta’s - Longest Substring Without Repeating Chars
Meta’s - Max Area of Island
Leetcode’s first problem
Twitch’s - LRU Cache
Microsoft’s Contains Duplicate
Google’s - Last Stone Weight
Microsoft’s - Kth Largest Element
Meta’s - K Closest Points
Meta’s - Partition Labels
Amazon’s - Combination Sum
Meta’s - Subsets
Microsoft’s - Path Sum
Amazon’s - Construct Binary Tree
Meta’s - Right Side View
Amazon’s - Kth Smallest Node In BST
Meta’s - Merge K Sorted Linked Lists
Amazon’s - Delete Node in BST
Amazon’s - Climbing Stairs
Microsoft’s - Search 2D Matrix
Google’s - ‘Koko Eating Bananas’