Tag: binary-search
- 132 Pattern
- 3Sum Smaller
- Adjacent Increasing Subarrays Detection II
- Apply Operations to Maximize Frequency Score
- Arranging Coins
- Avoid Flood in The City
- Binary Search
- Binary Searchable Numbers in an Unsorted Array
- Block Placement Queries
- Booking Concert Tickets in Groups
- Building Boxes
- Capacity To Ship Packages Within D Days
- Check If a Number Is Majority Element in a Sorted Array
- Check If N and Its Double Exist
- Closest Binary Search Tree Value
- Closest Equal Element Queries
- Closest Nodes Queries in a Binary Search Tree
- Closest Room
- Compare Strings by Frequency of the Smallest Character
- Count Complete Tree Nodes
- Count Good Triplets in an Array
- Count Negative Numbers in a Sorted Matrix
- Count Number of Rectangles Containing Each Point
- Count of Range Sum
- Count of Smaller Numbers After Self
- Count Pairs in Two Arrays
- Count Pairs Of Nodes
- Count Pairs Whose Sum is Less than Target
- Count Subarrays With More Ones Than Zeros
- Count Subarrays With Score Less Than K
- Count Substrings That Satisfy K-Constraint II
- Count the Number of Fair Pairs
- Count the Number of Incremovable Subarrays I
- Count the Number of Incremovable Subarrays II
- Count the Number of K-Big Indices
- Create Sorted Array through Instructions
- Cutting Ribbons
- Data Stream as Disjoint Intervals
- Design an Array Statistics Tracker
- Design Hit Counter
- Divide Chocolate
- Earliest Second to Mark Indices I
- Earliest Second to Mark Indices II
- Equalize Strings by Adding or Removing Characters at Ends
- Escape the Spreading Fire
- Fair Candy Swap
- Find a Peak Element II
- Find a Value of a Mysterious Function Closest to Target
- Find Beautiful Indices in the Given Array I
- Find Beautiful Indices in the Given Array II
- Find Building Where Alice and Bob Can Meet
- Find First and Last Position of Element in Sorted Array
- Find in Mountain Array
- Find K Closest Elements
- Find K-th Smallest Pair Distance
- Find Latest Group of Size M
- Find Longest Self-Contained Substring
- Find Longest Special Substring That Occurs Thrice I
- Find Longest Special Substring That Occurs Thrice II
- Find Maximum Non-decreasing Array Length
- Find Minimum in Rotated Sorted Array II
- Find Minimum in Rotated Sorted Array
- Find Peak Element
- Find Positive Integer Solution for a Given Equation
- Find Products of Elements of Big Array
- Find Right Interval
- Find Smallest Common Element in All Rows
- Find Smallest Letter Greater Than Target
- Find Subarray With Bitwise OR Closest to K
- Find Target Indices After Sorting Array
- Find the Distance Value Between Two Arrays
- Find the Duplicate Number
- Find the Index of Permutation
- Find the Index of the Large Integer
- Find the Kth Smallest Sum of a Matrix With Sorted Rows
- Find the Longest Equal Subarray
- Find the Longest Valid Obstacle Course at Each Position
- Find the Maximum Number of Marked Indices
- Find the Median of the Uniqueness Array
- Find the Number of Subarrays Where Boundary Elements Are Maximum
- Find the Safest Path in a Grid
- Find the Smallest Divisor Given a Threshold
- Find the Student that Will Replace the Chalk
- Find Two Non-overlapping Sub-arrays Each With Target Sum
- First Bad Version
- Fixed Point
- Frequency of the Most Frequent Element
- Friends Of Appropriate Ages
- Frog Jump II
- Fruits Into Baskets II
- Fruits Into Baskets III
- Get Equal Substrings Within Budget
- Guess Number Higher or Lower
- H-Index II
- Heaters
- House Robber IV
- Intersection of Three Sorted Arrays
- Intersection of Two Arrays II
- Intersection of Two Arrays
- K-diff Pairs in an Array
- K-th Smallest Prime Fraction
- Koko Eating Bananas
- Kth Ancestor of a Tree Node
- Kth Missing Positive Number
- Kth Smallest Amount With Single Denomination Combination
- Kth Smallest Element in a Sorted Matrix
- Kth Smallest Number in Multiplication Table
- Kth Smallest Product of Two Sorted Arrays
- Kth Smallest Subarray Sum
- Last Day Where You Can Still Cross
- Leftmost Column with at Least a One
- Length of the Longest Increasing Path
- Longest Arithmetic Subsequence
- Longest Common Subpath
- Longest Duplicate Substring
- Longest Increasing Subsequence
- Longest Repeating Substring
- Longest Square Streak in an Array
- Longest Subsequence With Limited Sum
- Longest Uploaded Prefix
- Magnetic Force Between Two Balls
- Make Array Empty
- Make Array Strictly Increasing
- Max Consecutive Ones III
- Max Sum of Rectangle No Larger Than K
- Maximize Active Section with Trade II
- Maximize Score of Numbers in Ranges
- Maximize the Confusion of an Exam
- Maximize the Distance Between Points on a Square
- Maximize the Minimum Game Score
- Maximize the Minimum Powered City
- Maximize the Profit as the Salesman
- Maximize Win From Two Segments
- Maximum Average Subarray II
- Maximum Balanced Subsequence Sum
- Maximum Beauty of an Array After Applying Operation
- Maximum Candies Allocated to K Children
- Maximum Coins From K Consecutive Bags
- Maximum Coins Heroes Can Collect
- Maximum Count of Positive Integer and Negative Integer
- Maximum Distance Between a Pair of Values
- Maximum Earnings From Taxi
- Maximum Font to Fit a Sentence in a Screen
- Maximum Frequency of an Element After Performing Operations I
- Maximum Frequency of an Element After Performing Operations II
- Maximum Fruits Harvested After At Most K Steps
- Maximum GCD-Sum of a Subarray
- Maximum Length of Repeated Subarray
- Maximum Number of Alloys
- Maximum Number of Events That Can Be Attended II
- Maximum Number of Groups Entering a Competition
- Maximum Number of Groups With Increasing Length
- Maximum Number of Integers to Choose From a Range I
- Maximum Number of Integers to Choose From a Range II
- Maximum Number of Removable Characters
- Maximum Number of Robots Within Budget
- Maximum Number of Tasks You Can Assign
- Maximum Number of Upgradable Servers
- Maximum Number That Sum of the Prices Is Less Than or Equal to K
- Maximum Points Inside the Square
- Maximum Profit in Job Scheduling
- Maximum Running Time of N Computers
- Maximum Score of a Good Subarray
- Maximum Score of Non-overlapping Intervals
- Maximum Side Length of a Square with Sum Less than or Equal to Threshold
- Maximum Sized Array
- Maximum Strictly Increasing Cells in a Matrix
- Maximum Sum Queries
- Maximum Tastiness of Candy Basket
- Maximum Total Beauty of the Gardens
- Maximum Total Damage With Spell Casting
- Maximum Value at a Given Index in a Bounded Array
- Maximum White Tiles Covered by a Carpet
- Median of a Row Wise Sorted Matrix
- Median of Two Sorted Arrays
- Merge BSTs to Create Single BST
- Minimize Connected Groups by Inserting Interval
- Minimize Max Distance to Gas Station
- Minimize Maximum of Array
- Minimize the Maximum Adjacent Element Difference
- Minimize the Maximum Difference of Pairs
- Minimize the Maximum Edge Weight of Graph
- Minimize the Maximum of Two Arrays
- Minimized Maximum of Products Distributed to Any Store
- Minimum Absolute Difference Between Elements With Constraint
- Minimum Absolute Sum Difference
- Minimum Array Length After Pair Removals
- Minimum Common Value
- Minimum Cost to Make Array Equal
- Minimum Cost to Make Array Equalindromic
- Minimum Garden Perimeter to Collect Enough Apples
- Minimum Interval to Include Each Query
- Minimum Limit of Balls in a Bag
- Minimum Number of Days to Make m Bouquets
- Minimum Number of Increasing Subsequence to Be Removed
- Minimum Number of Operations to Make Array Continuous
- Minimum Number of Removals to Make Mountain Array
- Minimum Number of Seconds to Make Mountain Height Zero
- Minimum Number of Valid Strings to Form Target I
- Minimum Number of Valid Strings to Form Target II
- Minimum Operations to Make a Subsequence
- Minimum Operations to Make All Array Elements Equal
- Minimum Operations to Make Numbers Non-positive
- Minimum Operations to Make the Array K-Increasing
- Minimum Operations to Reduce X to Zero
- Minimum Relative Loss After Buying Chocolates
- Minimum Size Subarray Sum
- Minimum Space Wasted From Packaging
- Minimum Speed to Arrive on Time
- Minimum Sum of Squared Difference
- Minimum Sum of Values by Dividing Array
- Minimum Time For K Virus Variants to Spread
- Minimum Time to Complete All Tasks
- Minimum Time to Complete Trips
- Minimum Time to Eat All Grains
- Minimum Time to Repair Cars
- Missing Element in Sorted Array
- Missing Number
- Most Beautiful Item for Each Query
- Most Profit Assigning Work
- My Calendar I
- My Calendar II
- My Calendar III
- Next Greater Element IV
- Nth Digit
- Nth Magical Number
- Number of Equal Numbers Blocks
- Number of Excellent Pairs
- Number of Flowers in Full Bloom
- Number of Matching Subsequences
- Number of Pairs Satisfying Inequality
- Number of Subarrays With AND Value of K
- Number of Subsequences That Satisfy the Given Sum Condition
- Numbers At Most N Given Digit Set
- Online Election
- Online Majority Element In Subarray
- Partition Array Into Two Arrays to Minimize Sum Difference
- Path With Maximum Minimum Value
- Path With Minimum Effort
- Peak Index in a Mountain Array
- Plates Between Candles
- Pour Water Between Buckets to Make Water Levels Equal
- Preimage Size of Factorial Zeroes Function
- Prime Subtraction Operation
- Random Pick with Blacklist
- Random Pick with Weight
- Random Point in Non-overlapping Rectangles
- Range Frequency Queries
- Range Sum of Sorted Subarray Sums
- Reach a Number
- Reverse Pairs
- Russian Doll Envelopes
- Search a 2D Matrix II
- Search a 2D Matrix
- Search in a Sorted Array of Unknown Size
- Search in Rotated Sorted Array II
- Search in Rotated Sorted Array
- Search Insert Position
- Search Suggestions System
- Sell Diminishing-Valued Colored Balls
- Separate Squares I
- Separate Squares II
- Shortest Distance to Target Color
- Shortest Matching Substring
- Shortest Subarray to be Removed to Make Array Sorted
- Shortest Subarray with Sum at Least K
- Shortest Way to Form String
- Single Element in a Sorted Array
- Smallest Good Base
- Smallest Rectangle Enclosing Black Pixels
- Smallest Subarrays With Maximum Bitwise OR
- Smallest Substring With Identical Characters I
- Smallest Substring With Identical Characters II
- Snapshot Array
- Sorted GCD Pair Queries
- Sorting Three Groups
- Special Array II
- Special Array With X Elements Greater Than or Equal X
- Split Array Largest Sum
- Split Message Based on Limit
- Sqrt(x)
- Subarray Product Less Than K
- Subsequence With the Minimum Score
- Successful Pairs of Spells and Potions
- Sum of Floored Pairs
- Sum of Mutated Array Closest to Target
- Sum of Scores of Built Strings
- Sum of Square Numbers
- Super Egg Drop
- Swim in Rising Water
- The K Weakest Rows in a Matrix
- The Latest Time to Catch a Bus
- Time Based Key-Value Store
- Tweet Counts Per Frequency
- Two Best Non-Overlapping Events
- Two Sum BSTs
- Two Sum II - Input Array Is Sorted
- Two Sum Less Than K
- Ugly Number III
- Valid Perfect Square
- Valid Triangle Number
- Ways to Split Array Into Three Subarrays
- Zero Array Transformation II