GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing leetcodejavascript.com — Binary Search LeetCode Problems | JavaScript Solutions

Binary Search | LeetCode Problems

241 Binary Search solutions to LeetCode solutions.

View Source Code on GitHub
All 2765 Array 1587 String 683 Hash Table 587 Math 485 Dynamic Programming 458 Sorting 384 Greedy 348 Depth-First Search 293 Binary Search 241 Tree 227 Breadth-First Search 224 Matrix 223 Two Pointers 200 Bit Manipulation 197 Binary Tree 175 Prefix Sum 159 Stack 154 Heap Priority Queue 152 Simulation 150 Counting 134 Graph 133 Design 123 Sliding Window 112 Backtracking 104 Union Find 79 Enumeration 78 Linked List 78 Ordered Set 60 Monotonic Stack 55 Trie 51 Number Theory 47 Divide and Conquer 46 Recursion 45 Bitmask 41 Queue 41 Binary Search Tree 40 Segment Tree 38 Memoization 36 Geometry 36 Combinatorics 35 Topological Sort 33 Hash Function 30 Binary Indexed Tree 28 Game Theory 26 String Matching 23 Shortest Path 23 Interactive 23 Rolling Hash 22 Data Stream 20 Brainteaser 16 Monotonic Queue 14 Randomized 12 Merge Sort 12 Doubly-Linked List 11 Counting Sort 10 Iterator 9 Probability and Statistics 7 Quickselect 7 Suffix Array 6 Bucket Sort 6 Line Sweep 5 Minimum Spanning Tree 5 Reservoir Sampling 4 Strongly Connected Component 3 Eulerian Circuit 3 Radix Sort 3 Rejection Sampling 2 Biconnected Component 1

Binary Search Problems View all solutions →

Median of Two Sorted Arrays

#4 Hard

Search in Rotated Sorted Array

#33 Medium

Find First and Last Position of Element in Sorted Array

#34 Medium

Search Insert Position

#35 Easy

Sqrt(x)

#69 Medium

Search a 2D Matrix

#74 Medium

Search in Rotated Sorted Array II

#81 Medium

Find Minimum in Rotated Sorted Array

#153 Medium

Find Minimum in Rotated Sorted Array II

#154 Hard

Find Peak Element

#162 Medium

Two Sum II - Input Array Is Sorted

#167 Easy

Minimum Size Subarray Sum

#209 Medium

Count Complete Tree Nodes

#222 Easy

Search a 2D Matrix II

#240 Medium

3Sum Smaller

#259 Medium

Missing Number

#268 Easy

Closest Binary Search Tree Value

#270 Easy

H-Index II

#275 Medium

First Bad Version

#278 Medium

Find the Duplicate Number

#287 Medium

Longest Increasing Subsequence

#300 Medium

Smallest Rectangle Enclosing Black Pixels

#302 Hard

Count of Smaller Numbers After Self

#315 Hard

Count of Range Sum

#327 Hard

Intersection of Two Arrays

#349 Easy

Intersection of Two Arrays II

#350 Easy

Data Stream as Disjoint Intervals

#352 Hard

Russian Doll Envelopes

#354 Hard

Design Hit Counter

#362 Medium

Max Sum of Rectangle No Larger Than K

#363 Hard

Valid Perfect Square

#367 Easy

Guess Number Higher or Lower

#374 Medium

Kth Smallest Element in a Sorted Matrix

#378 Medium

Nth Digit

#400 Medium

Split Array Largest Sum

#410 Hard

Find Right Interval

#436 Medium

Arranging Coins

#441 Easy

132 Pattern

#456 Medium

Heaters

#475 Medium

Smallest Good Base

#483 Hard

Reverse Pairs

#493 Hard

Random Point in Non-overlapping Rectangles

#497 Medium

Random Pick with Weight

#528 Medium

K-diff Pairs in an Array

#532 Medium

Single Element in a Sorted Array

#540 Medium

Valid Triangle Number

#611 Medium

Sum of Square Numbers

#633 Medium

Maximum Average Subarray II

#644 Hard

Find K Closest Elements

#658 Medium

Kth Smallest Number in Multiplication Table

#668 Hard

Search in a Sorted Array of Unknown Size

#702 Medium

Binary Search

#704 Easy

Random Pick with Blacklist

#710 Hard

Subarray Product Less Than K

#713 Medium

Maximum Length of Repeated Subarray

#718 Medium

Find K-th Smallest Pair Distance

#719 Hard

My Calendar I

#729 Medium

My Calendar II

#731 Medium

My Calendar III

#732 Hard

Find Smallest Letter Greater Than Target

#744 Easy

Reach a Number

#754 Medium

Minimize Max Distance to Gas Station

#774 Hard

Swim in Rising Water

#778 Hard

K-th Smallest Prime Fraction

#786 Medium

Number of Matching Subsequences

#792 Medium

Preimage Size of Factorial Zeroes Function

#793 Hard

Friends Of Appropriate Ages

#825 Medium

Most Profit Assigning Work

#826 Medium

Peak Index in a Mountain Array

#852 Medium

Shortest Subarray with Sum at Least K

#862 Hard

Koko Eating Bananas

#875 Medium

Nth Magical Number

#878 Hard

Super Egg Drop

#887 Hard

Fair Candy Swap

#888 Easy

Numbers At Most N Given Digit Set

#902 Hard

Online Election

#911 Medium

Time Based Key-Value Store

#981 Medium

Max Consecutive Ones III

#1004 Medium

Capacity To Ship Packages Within D Days

#1011 Medium

Longest Arithmetic Subsequence

#1027 Medium

Longest Duplicate Substring

#1044 Hard

Shortest Way to Form String

#1055 Medium

Missing Element in Sorted Array

#1060 Medium

Longest Repeating Substring

#1062 Medium

Fixed Point

#1064 Easy

Find in Mountain Array

#1095 Hard

Two Sum Less Than K

#1099 Easy

Path With Maximum Minimum Value

#1102 Medium

Snapshot Array

#1146 Medium

Check If a Number Is Majority Element in a Sorted Array

#1150 Easy

Online Majority Element In Subarray

#1157 Hard

Compare Strings by Frequency of the Smallest Character

#1170 Medium

Shortest Distance to Target Color

#1182 Medium

Make Array Strictly Increasing

#1187 Hard

Find Smallest Common Element in All Rows

#1198 Medium

Ugly Number III

#1201 Medium

Get Equal Substrings Within Budget

#1208 Medium

Intersection of Three Sorted Arrays

#1213 Easy

Two Sum BSTs

#1214 Medium

Divide Chocolate

#1231 Hard

Maximum Profit in Job Scheduling

#1235 Hard

Find Positive Integer Solution for a Given Equation

#1237 Medium

Search Suggestions System

#1268 Medium

Find the Smallest Divisor Given a Threshold

#1283 Medium

Maximum Side Length of a Square with Sum Less than or Equal to Threshold

#1292 Medium

Sum of Mutated Array Closest to Target

#1300 Medium

The K Weakest Rows in a Matrix

#1337 Easy

Check If N and Its Double Exist

#1346 Easy

Tweet Counts Per Frequency

#1348 Medium

Count Negative Numbers in a Sorted Matrix

#1351 Easy

Find the Distance Value Between Two Arrays

#1385 Easy

Leftmost Column with at Least a One

#1428 Medium

Find the Kth Smallest Sum of a Matrix With Sorted Rows

#1439 Hard

Find Two Non-overlapping Sub-arrays Each With Target Sum

#1477 Medium

Minimum Number of Days to Make m Bouquets

#1482 Medium

Kth Ancestor of a Tree Node

#1483 Hard

Avoid Flood in The City

#1488 Medium

Number of Subsequences That Satisfy the Given Sum Condition

#1498 Medium

Range Sum of Sorted Subarray Sums

#1508 Medium

Find a Value of a Mysterious Function Closest to Target

#1521 Hard

Find the Index of the Large Integer

#1533 Medium

Kth Missing Positive Number

#1539 Easy

Magnetic Force Between Two Balls

#1552 Medium

Find Latest Group of Size M

#1562 Medium

Shortest Subarray to be Removed to Make Array Sorted

#1574 Medium

Special Array With X Elements Greater Than or Equal X

#1608 Easy

Maximum Font to Fit a Sentence in a Screen

#1618 Medium

Path With Minimum Effort

#1631 Medium

Sell Diminishing-Valued Colored Balls

#1648 Medium

Create Sorted Array through Instructions

#1649 Hard

Minimum Operations to Reduce X to Zero

#1658 Medium

Minimum Number of Removals to Make Mountain Array

#1671 Hard

Ways to Split Array Into Three Subarrays

#1712 Medium

Minimum Operations to Make a Subsequence

#1713 Hard

Building Boxes

#1739 Hard

Maximum Number of Events That Can Be Attended II

#1751 Hard

Minimum Limit of Balls in a Bag

#1760 Medium

Count Pairs Of Nodes

#1782 Hard

Maximum Score of a Good Subarray

#1793 Hard

Maximum Value at a Given Index in a Bounded Array

#1802 Medium

Minimum Absolute Sum Difference

#1818 Medium

Frequency of the Most Frequent Element

#1838 Medium

Closest Room

#1847 Hard

Minimum Interval to Include Each Query

#1851 Hard

Maximum Distance Between a Pair of Values

#1855 Medium

Sum of Floored Pairs

#1862 Hard

Minimum Speed to Arrive on Time

#1870 Medium

Count Pairs in Two Arrays

#1885 Medium

Minimum Space Wasted From Packaging

#1889 Hard

Cutting Ribbons

#1891 Medium

Find the Student that Will Replace the Chalk

#1894 Medium

Maximum Number of Removable Characters

#1898 Medium

Find a Peak Element II

#1901 Medium

Kth Smallest Subarray Sum

#1918 Medium

Longest Common Subpath

#1923 Hard

Merge BSTs to Create Single BST

#1932 Hard

Minimum Garden Perimeter to Collect Enough Apples

#1954 Medium

Minimum Time For K Virus Variants to Spread

#1956 Hard

Find the Longest Valid Obstacle Course at Each Position

#1964 Hard

Binary Searchable Numbers in an Unsorted Array

#1966 Medium

Last Day Where You Can Still Cross

#1970 Hard

Maximum Earnings From Taxi

#2008 Medium

Minimum Number of Operations to Make Array Continuous

#2009 Hard

Maximize the Confusion of an Exam

#2024 Medium

Count Subarrays With More Ones Than Zeros

#2031 Medium

Partition Array Into Two Arrays to Minimize Sum Difference

#2035 Hard

Kth Smallest Product of Two Sorted Arrays

#2040 Hard

Two Best Non-Overlapping Events

#2054 Medium

Plates Between Candles

#2055 Medium

Minimized Maximum of Products Distributed to Any Store

#2064 Medium

Most Beautiful Item for Each Query

#2070 Medium

Maximum Number of Tasks You Can Assign

#2071 Hard

Range Frequency Queries

#2080 Medium

Find Target Indices After Sorting Array

#2089 Easy

Maximum Fruits Harvested After at Most K Steps

#2106 Hard

Minimum Operations to Make the Array K-Increasing

#2111 Hard

Pour Water Between Buckets to Make Water Levels Equal

#2137 Medium

Maximum Running Time of N Computers

#2141 Hard

Count Good Triplets in an Array

#2179 Hard

Minimum Time to Complete Trips

#2187 Medium

Sum of Scores of Built Strings

#2223 Hard

Maximum Candies Allocated to K Children

#2226 Medium

Maximum Total Beauty of the Gardens

#2234 Hard

Count Number of Rectangles Containing Each Point

#2250 Medium

Number of Flowers in Full Bloom

#2251 Hard

Escape the Spreading Fire

#2258 Hard

Maximum White Tiles Covered by a Carpet

#2271 Medium

Booking Concert Tickets in Groups

#2286 Hard

Successful Pairs of Spells and Potions

#2300 Medium

Count Subarrays With Score Less Than K

#2302 Hard

The Latest Time to Catch a Bus

#2332 Medium

Minimum Sum of Squared Difference

#2333 Medium

Number of Excellent Pairs

#2354 Hard

Maximum Number of Groups Entering a Competition

#2358 Medium

Median of a Row Wise Sorted Matrix

#2387 Medium

Longest Subsequence With Limited Sum

#2389 Easy

Maximum Number of Robots Within Budget

#2398 Hard

Smallest Subarrays With Maximum Bitwise OR

#2411 Medium

Number of Pairs Satisfying Inequality

#2426 Hard

Minimize Maximum of Array

#2439 Medium

Minimum Cost to Make Array Equal

#2448 Hard

Split Message Based on Limit

#2468 Hard

Closest Nodes Queries in a Binary Search Tree

#2476 Medium

Frog Jump II

#2498 Medium

Longest Square Streak in an Array

#2501 Medium

Maximum Tastiness of Candy Basket

#2517 Medium

Count the Number of K-Big Indices

#2519 Hard

Maximum Count of Positive Integer and Negative Integer

#2529 Easy

Minimum Common Value

#2540 Easy

Maximum Number of Integers to Choose From a Range I

#2554 Medium

Maximum Number of Integers to Choose From a Range II

#2557 Medium

House Robber IV

#2560 Medium

Count the Number of Fair Pairs

#2563 Medium

Find the Maximum Number of Marked Indices

#2576 Medium

Minimum Time to Repair Cars

#2594 Medium

Prime Subtraction Operation

#2601 Medium

Minimum Time to Eat All Grains

#2604 Hard

Minimize the Maximum Difference of Pairs

#2616 Medium

Minimum Operations to Make Numbers Non-positive

#2702 Hard

Maximum Beauty of an Array After Applying Operation

#2779 Medium

Minimum Relative Loss After Buying Chocolates

#2819 Hard

Count Pairs Whose Sum is Less than Target

#2824 Easy

Sorting Three Groups

#2826 Medium

Maximum Coins Heroes Can Collect

#2838 Medium

Number of Equal Numbers Blocks

#2936 Medium

Maximum GCD-Sum of a Subarray

#2941 Hard

Count the Number of Incremovable Subarrays I

#2970 Easy

Find Longest Special Substring That Occurs Thrice I

#2981 Medium

Find Longest Self-Contained Substring

#3104 Hard

Find the Index of Permutation

#3109 Medium

Equalize Strings by Adding or Removing Characters at Ends

#3135 Medium

Maximum Number of Upgradable Servers

#3155 Medium

Minimum Number of Increasing Subsequence to Be Removed

#3231 Hard

Minimize Connected Groups by Inserting Interval

#3323 Medium

Maximum Sized Array

#3344 Medium

Zero Array Transformation II

#3356 Medium

Design an Array Statistics Tracker

#3369 Hard

Maximize the Distance Between Points on a Square

#3464 Hard

Fruits Into Baskets II

#3477 Easy

Fruits Into Baskets III

#3479 Medium

Implement Router

#3508 Medium
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.