Skip to content

Rahul-Shukla0602/binary-search-solutions

 
 

Repository files navigation

Binary Search Solutions

Generate the table using python3:

pip install -r requirements.txt
python generate_readme.py
python update_readme.py
  • 🟢: Easy
  • 🟠: Medium
  • 🔴: Hard
  • 🔵: Harder
Id Question Difficulty Solution Notes
1 Sum of Two Numbers 🟢 cpp
2 Balanced Brackets 🟠 py
3 Regular Expression Matching 🔴
4 Hoppable 🟠 cpp
6 Palindromic Integer 🟢 cpp
7 Special Product List 🟠
8 First Missing Positive 🟠 cpp
9 Decode Message 🟠 py
10 Largest Sum of Non Adjacent Numbers 🟠 cpp DP
12 A Flight of Stairs 🟠
13 Univalue Tree Count 🟠 cpp
14 Longest Sublist with K Distinct Numbers 🔴 py
15 Collecting Coins 🟠 cpp
16 Sliding Window Max 🔴
20 Painting Houses 🔴
23 3 6 9 🟢 cpp
26 Labyrinthian Possibilities 🟠 cpp
31 Run Length Encoding 🟢 cpp
45 Strictly Increasing or Strictly Decreasing 🟢 cpp
46 Largest Number By Two Times 🟢 cpp
47 Subsequence Strings 🟠 cpp
49 Add Binary Numbers 🟠 cpp, py
50 Number of Islands 🟠 cpp
56 Generate Primes 🟢 py Sieve of Eratosthenes
57 Unique Occurrences 🟠 py
58 Longest Palindromic Subsequence 🔴 cpp, py
59 Longest Common Subsequence 🟠 cpp Dynamic Programming
60 A Unique String 🟢 py
62 Compress String 🟢 cpp
63 Rotation of Another String 🟢 cpp
64 One Edit Distance 🟠
65 First Missing Positive Sequel 🟠
67 Find the Largest Number in a Rotated List 🟠 cpp
69 Insertion Index in Sorted List 🟠 java
71 Packing Boxes 🟠 cpp, py
72 Balanced Brackets Sequel 🟠 py
73 Unidirectional Word Search 🟢 py
75 Longest Arithmetic Subsequence 🔴
76 Length of a Linked List 🟢 cpp
77 Kth Last Node of a Linked List 🟠 cpp
78 Reverse a Linked List 🟠 cpp
79 Palindrome Linked List 🟠 cpp
80 Rotate List Left by K 🟢 cpp
81 Largest Rectangle Submatrix 🔴
82 Bipartite Graph 🟠 py
83 Shortest Bridge 🔴 py
85 Largest K Divisible Subsequence 🔵
88 Sinking Islands 🔴 cpp
89 Farthest Point From Water 🔴
90 Longest Increasing Subsequence 🟠 cpp
91 Split String Into Palindromes 🔴
92 Rotate Linked List by K 🟠 cpp
93 Create Largest Number From a List 🔴 py
107 Zipped String 🔴
108 Currency Arbitrage 🔵
110 Nth Fibonacci Number 🟢 cpp
111 Wolf of Wall Street 🟢 java
112 High Frequency 🟢 py
113 Buy and Sell K Stocks 🔴
115 Square of a List 🟢 py
116 Recurring Character 🟢 cpp
117 The Accountant 🟠
118 Tree Sum 🟠 cpp
120 Leftmost Deepest Tree Node 🟠 cpp
124 Sum of the Deepest Nodes 🟠 cpp
125 Twin Trees 🟠 cpp
127 Set Bits 🟠
129 Longest Anagram Subsequence 🟠 cpp, py
130 Binary Search Tree Validation 🟠 cpp
131 Level Order Traversal 🟠 cpp
132 Kth Smallest in a Binary Search Tree 🟠 cpp
133 Invert Tree 🟠 cpp
135 Sudoku Solver 🟠
136 Search in a Binary Search Tree 🟠 cpp
137 Making Change 🟠 cpp
138 Merging Binary Trees 🟠 cpp
139 Anagram Partitioning 🟠 py
140 Zero Matrix 🟠 cpp
141 Merging Two Sorted Lists 🟢 cpp
142 Tree Pruning 🟠 cpp
143 Central Linked List 🟠 cpp
145 Largest Root to Leaf Sum 🟠 cpp
146 Most Frequent Subtree Sum 🟠 py
147 Spiral Matrix 🟠 cpp
148 Sum of the Digits 🟢 cpp
149 Break String Into Words 🔴
150 Connected Cities 🟠
151 Sort by Frequency and Value 🟠 py
152 Longest Tree Sum Path From Root to Leaf 🟠 cpp
154 Rain Catcher 🟠 py
155 Inorder Traversal 🟠 py
156 Detecting an Odd Length Cycle 🔴 py
158 A Strictly Increasing Linked List 🟢 cpp
163 Perfect Squares 🟠
164 Repeated Deletion 🟠 py
166 Interleaved String 🟢 cpp
167 Check Palindrome 🟢 cpp
168 Anagram Checks 🟢 cpp, py
169 List Partitioning 🟠 cpp
171 Max Product of Two Numbers 🟢 cpp
172 Removing Parentheses 🟠 cpp
174 Longest Consecutive Duplicate String 🟢 cpp
175 Next Integer Permutation 🔴 cpp
176 Unique Subsequences Equal to Target 🔴
177 Remove Duplicate Numbers 🟠 py
178 Postfix Notation Evaluation 🟠
180 Check Power of Two 🟢 cpp Bit Trick
181 Number of Bits 🟢 cpp
182 List Min Replacement 🟢 cpp
183 Rocketship Rescue 🟠
184 Short Circuit 🔵
186 Longest Zero Sublist Sum 🔴 py
187 Edit Distance 🟠 cpp, py
188 Merge New Interval 🔴
189 Longest Palindromic Substring 🟠 java
190 H Index 🟠
191 Space Battle 🟠
193 Longest Distinct Sublist 🟠
194 Longest Consecutive Run of 1s in Binary 🟠 java Bit Trick
196 Sudoku Validator 🟠
197 Repeated Addition 🟢 cpp
199 A Maniacal Walk 🔴
200 Longest Increasing Path 🔴 py
201 Pascal's Triangle 🟢 cpp
202 Number of Palindromic Substrings 🟠 cpp
203 Detect the Only Duplicate in a List 🟢 cpp
204 Swap Consecutive Index Pairs 🟢 cpp
205 Paint Bucket 🟠 py
206 Largest Binary Search Subtree in Nodes 🔴
208 Longest Consecutive Sequence 🟠 py
209 Tromino Theory 🔴
210 Height Balanced Tree 🟠 cpp
213 Collatz Sequence 🟢 cpp
214 Count BST Nodes in a Range 🟠 cpp
215 Transpose of a Matrix 🟢 py
216 Maximal Sublist Product 🟠
218 Integer to Base 3 🟢 cpp
219 Line Segment 🟠 py
220 Consecutive Duplicates 🟢 cpp
221 Flight Itinerary 🟠 py
222 Toeplitz Matrix 🟢 cpp
223 Interleaved Linked List 🟠 cpp
224 Sort a Linked List 🟠 cpp, py
225 Sort by Permutation 🟠 cpp
226 String Expansion 🔴 py
227 Unix Path Resolution 🟢 cpp
228 Linked List to Integer 🟢 cpp
230 S Expression Evaluation 🔴
231 No New Friends 🟠 py
232 Friend Groups 🟠 py
235 Hamming Distance 🟢 cpp
237 Rotate by 90 Degrees Counter Clockwise 🟠 py
238 Sorted Elements 🟢 py
239 Pairwise Linked List Swap 🟠 cpp, java
240 Merging K Sorted Lists 🟠 java
241 Column Sort 🟢 py
242 Diagonal Sort 🟠 py
244 Largest Sublist Sum 🟠 cpp
245 Matrix Search 🟠 cpp, py
248 Foo Bar Qaz Qux 🔴
249 Palindromic Anagram 🟠 py
250 Long Distance 🟠
251 Sort String by Flipping 🟠
252 Kth Smallest Element 🟠 cpp Quickselect
253 Matrix Search Sequel 🟠 cpp
254 Minimum Deletions From the Ends for Equilibrium 🟠
255 Subsequence Sum 🟠
256 Longest Contiguously Strictly Increasing Sublist After Deletion 🟠
258 N Queens Puzzle 🔴
259 Number of Unique Binary Search Trees 🟠
261 Reverse Words 🟢 cpp, py
262 Reverse Words Sequel 🟠
265 Clock Angle 🟠 java
266 Median Minimization 🟢 cpp
269 Left Side View of a Tree 🟠 cpp
271 Reverse Linked List Groups 🟠 cpp
272 Stack Sequence 🟠 py
273 Minimum Bracket Addition 🟢 cpp
275 Conway's Game of Life 🟠 py
276 Complete Binary Tree 🟠 cpp
278 Sum Tree 🟠 cpp
279 Interval Overlaps 🟠 py
280 Candy Race 🔴
281 Median of Two Sorted Lists 🔴
282 Condo Developers 🟠 py
283 Ascending Cards 🟠
284 Flight Itinerary Sequel 🟠
285 Odd Number of Digits 🟢 py
286 Delete Even Leaves 🟠 cpp
288 Minimum Digit Delete 🔴
289 Make Lists Same with Sublist Sum Operations 🟠
290 Swap Characters to Equalize Strings 🟢 py
294 Longest Common Substring 🟠 cpp
298 Text Editor 🟢 cpp
299 Seat Arrangement 🟢
300 Convert to Full Binary Tree 🟠 cpp
301 Swapping Socks 🔴
302 Dividing Station 🔴 py
303 Level Order Alternating 🟠 py
304 Hanging Banners 🔴
306 Longest Common Subsequence of Three Strings 🔴 cpp
307 IP Address Combinations 🔴 py
308 Linked List Deletion 🟢 cpp
309 Edges that Disconnect the Graph 🔵
310 Direct Closure 🟠
312 Distributed Systems 🔴
314 Longest 1s After One Swap 🟠
315 Maximum Removal Subsequence String 🔴
316 Shortest Sublist to Sort 🟢 cpp
317 Collision Detection 🔴
318 Longest Tree Path 🟠 cpp
319 K Partitionable List 🔴
320 Phone Number Combinations 🟠 py
321 Task Hare 🟢 cpp
322 Happy Numbers 🟢 py
324 Making Change Sequel 🟠
325 Maximum Non Adjacent Tree Sum 🟠
326 24 🔴
327 Add One to List 🟢 cpp
328 Moo 🔴
329 Roman Numeral to Integer 🟠 py
330 Remove Interval Overlaps 🟠
332 Reverse Graph 🟠 py
333 Pythagorean Triplets 🟢 cpp
334 List to Binary Search Tree 🟠 py
335 Movie Theatres 🟠 py
337 Dice Throw 🟠 py
338 Valid N Queens 🟠 py
339 Prime Factorization 🟢 cpp
340 Mindboggling 🔴
341 Binary Tree to Linked List 🟠 cpp
342 Justify Text 🔴
344 Roomba 🟢 py
345 Largest Tree Sum Path 🟠 cpp
346 Ancient Astronaut Theory 🟢 py
347 Spiky Plants 🔴
348 Binary Tree Width 🟠
349 Uber Pool 🟠 py
350 Fair Pay 🟠
351 Minimum Window Substring 🔴 py
353 Triangle Triplets 🟠
354 Add Linked Lists 🟠 cpp
356 Remove Duplicates in Linked List 🟠 cpp
357 Course Scheduling 🟠
358 Greatest Common Divisor 🟢 cpp
359 Sibling Tree Value 🟠 cpp
360 Lowest Common Ancestor 🟠 cpp
361 Top View of a Tree 🔴 py
362 The Auditor 🟠 cpp
363 Linked List to Binary Search Tree 🟠 py
364 Univalue Tree 🟠 cpp
366 Cutting Binary Search Tree 🟠 cpp
368 Number of Hops 🟠
369 Sum of Right Leaves 🟠 cpp
370 Wildfire 🟠
372 Common Words 🟢 py
373 Dictionary Nomad 🔴
374 Unique Characters of Every Substring 🔴
375 Diverse Words 🔴
376 Best Interval to Remove 🔵
377 Sublist Sum 🟠
381 Sorting Mail 🟠 py
382 All Sublists Sum 🟠
384 Look and Say 🟠 py
385 Minimum Difference 🟠
387 Buying Cars 🟢 cpp
388 Mixed Sorting 🟢 cpp, py
389 Squares in a Grid 🔵
390 Base 3 to Integer 🟢 cpp
391 Lego Towers 🟠
392 Roomba Sequel 🔴
393 3 and 7 🟢 cpp
395 A Number and Its Triple 🟢 cpp
396 Equivalent Value and Frequency 🟢 py
397 Elephant Tree 🟠 cpp
398 Escape Maze 🟠
400 Subsequence Picking 🔵
405 Target Number with Operations Sequel 🟠
406 String Isomorphism 🟢 py
409 Sum of Three Numbers 🟠 java
410 City Blocks 🟢 py
412 Tree Traversal 🟠 py
415 8 Puzzle 🔴
416 Palindromic Tree 🟠 py
417 Parity Jump 🔴
418 Inverse Factorial 🟢 cpp
419 Remove One Letter 🟢 cpp
421 Minimum Spanning Tree 🔵
422 Smallest Difference 🔴
423 Big Numbers 🟢 cpp
424 Target Number with Operations 🟢 cpp
425 Latin Square 🟢 py
426 Symmetric Binary Tree 🟠 cpp
428 Partition Tree 🟠 py
429 Vertical Cipher 🟢 py
430 Leaderboard 🟢 py
431 Word Formation 🟢 py
433 Minimum Parsing Tree 🔵
435 Longest Rotated Palindromic Substring 🔴
436 Level Order Binary Tree to Linked List 🟠 cpp
437 Longest Alliteration 🟢 cpp
440 Index Into an Infinite String 🟢 cpp
442 Bomber Man 🟠 py
448 Linked List to ZigZag Tree Path 🟠 cpp
449 Distinct Palindromes 🟠
450 Number of Swaps to Sort 🟠
453 Word Formation Sequel 🟠
456 Narcissistic Number 🟢 cpp
459 Maximum Number by Inserting Five 🟢 py
460 As Before Bs 🟠
461 Equal Piles 🟠 py
462 Bounce 🟠
463 Run Length Decoding 🟢 py
464 Symmetric Blocks 🟠
465 A Student 🔴
467 A* Student 🔵
471 K and K 🟢 cpp
472 Adjacent Swaps to Group Ones 🔴
473 Unique Ab Strings 🟢 cpp
474 Largest Anagram Group 🟠 py
477 Trimmed Palindromes 🟠
478 Interval Duration 🟠 py
479 Longest Alternating Subsequence 🔴
480 Bus Fare 🟠
481 Tree From PreInorder Traversals 🟠 py
482 Detect Voter Fraud 🟢 java
483 Leaves in Same Level 🟠 cpp
484 123 Number Flip 🟢 cpp
485 Task Schedule 🟠
486 Largest and Smallest Difference 🟠 py
487 Swappable Trees 🟠 cpp
488 Longest Interval 🟠 py LineSweep
489 Minimum Cost Sort 🟢 py
491 Leaf Equivalent Trees 🟠 py
492 Max Character Distinct Words 🟠
494 Longest Even Value Path 🟠 cpp
495 Rectangular Overlap 🟢 py
496 Longest Even Sum Path 🔴
498 Robinhood 🟢 java
499 Linked List Folding 🟠 cpp
500 The Meeting Place 🟠
501 FizzBuzz 🟢 cpp
503 Weekly Contest 🔵
505 The Meeting Place Sequel 🔴
506 One Integer 🟠 py
507 Largest Square Submatrix 🔴 py
509 Points on a Line 🔴
510 Contiguous Intervals 🟠 py
511 Ways to Sum Consecutive Numbers to N 🟠
513 Count Submatrices That Sum Target 🔴 py
514 Linked List Partitioning 🟠 cpp
517 Number of Sublists With Sum of Target 🟠 py
518 Steady Speed 🟠 py
519 Next Binary Permutation 🟠
520 Dominos 🔴
521 Range Update 🟠 py
522 Light Bulb Toggling 🟠
524 Cut Matrix 🔴
525 Knight Remains 🟠
528 Ghost 🔴
529 Shortest String 🟢 cpp
530 Odd Palindrome 🟠 cpp
533 Line of People 🟢 cpp
536 K Unique String 🟠 py
537 Trailing Zeros 🔴
538 Bunnyhopping 🔴
539 Sum of First N Odd Integers 🟢 cpp
540 Copy Paste 🟠
541 Sum of Three Numbers Sequel 🟠
542 Factory Trail 🟠
544 Multiple Parentheses 🔴
545 Boxes All the Way Down 🔴
547 Repeating String 🟢 py
548 Consecutively Descending Integers 🟢 py
551 Overchoice 🟠
552 Reflected Binary Code 🟠 cpp
555 Sum of Four Numbers 🟠 py
556 String Multiplication 🟠
557 K Largest Pairs 🔵
558 N Lexicographic Integers 🟠 py
559 Minimum Set of Pairs 🟠
560 Selling Products 🟠 py
563 Factorial Sum 🟠 py
564 N Rooks 🟢 java
565 Rookie Mistake 🟢 cpp
566 Coprime Suspects 🟠
567 Country Roads 🔴
568 Outstanding Move 🔴
569 Outstanding Move Sequel 🔵
570 Split Product 🟠
571 String Construction 🟠
573 Parentheses Grouping 🟢 py
574 Majority Vote 🟠 cpp
575 Class Scheduling 🟠
576 Linked List Delete Last Occurrence of Value 🟠 cpp
577 Remove Last Duplicate Entries 🟢 py
581 Fractional Knapsack 🟠 py
582 DDoS Protection 🔴
583 Multi Knapsack 🔴
584 0 1 Knapsack 🟠 py
585 Poly Knapsack 🟠 cpp, py
586 Shipping and Receiving 🟠 py
587 Linked List Intersection 🟠 cpp
588 Linked List Union 🟠 cpp
591 Make Palindrome by Adding a Suffix 🔴
592 Make a Palindrome by Inserting Characters 🟠 cpp
595 Decimal Number 🔴
596 Island Shape Perimeter 🟠 py
598 Smallest Sublist Sum at Least Target 🔴
599 Guess the Root 🟢 cpp
600 Interval Union 🟠 py
601 Interval Intersection 🟢 java
602 Non Decreasing Digits 🟠
604 Maximum Consecutive Difference 🔴
605 Anagram Difference 🔴
606 Cell Fusion 🟢 py
607 Longest Common Prefix 🟢 cpp
608 Anagram Substrings 🟠 py
609 String Addition 🟢 cpp
610 List Equality with Increments 🟢 cpp
611 Submajority Vote 🟠 cpp
614 Count Exact Sum 🔴 py
616 Parse Boolean Expression 🟠 py
618 Largest Gap 🟢 py
619 Embolden 🟠
620 Subsequence Widths 🔴
621 Longest Path in a Graph 🔴
622 2048 🟠 py
625 Bubble Swap 🟠 py
626 Minimum Distance of Two Words in a Sentence 🟢
633 Next Closest Odd Digit Number 🔴
634 Weird Clock 🟠
635 Upside Down Numbers 🟠 py
636 Rotation Groups 🟢
637 Reverse an Inner Linked List 🟠 cpp
638 Longest Substring with 2 Distinct Characters 🟠 py
639 Back to Front Linked List 🟠 py
641 Sentence Reversal 🟠 cpp
642 Flipped Matrix 🟠
644 Inorder Successor 🟠 cpp
645 Bear of Wall Street 🟠
646 Interval Carving 🟠
647 Last to Toggle Wins 🔴
648 Pattern Matching 🔴
649 Rain Catcher Sequel 🔵
650 Subtree 🟠 cpp
651 Lone Integer 🟠 cpp Bit Trick
652 Parse Ternary Expression 🟠
654 Number of Unique Character Substrings 🟢 py
655 Digital Lake 🔵
656 Split List Into Strictly Increasing Chunks 🔴
657 Bomber Man Sequel 🟠
658 Binary Tree Longest Consecutive Path 🔴
659 Number of Quadruplets That Sum Target 🟠
660 Distance Pair 🟠
661 Fleet of Palindromes 🟠
663 Broker of Wall Street 🟠
664 Small Large Medium 🔴
665 Arithmetic Sequences 🟠 py
666 Arithmetic Subsequences 🟠
667 List Consecutive Split 🟠
668 Rod Cutting 🟠 py
669 Count of Sublists with Same First and Last Values 🟠 cpp
670 Lexicographic Swap 🟢 py
671 Calculator 🔴
672 Length of Longest Balanced Subsequence 🟠 cpp
673 Longest Bitonic Subsequence 🟠 cpp
674 K Prefix 🟢 cpp
675 K Compare 🟠
676 Popularity 🔴
677 K Subsequence 🔵
679 Increasing Digits 🟠 cpp
681 Wolves of Wall Street 🟢 java
682 Bull of Wall Street 🔴
683 Palindrome Count 🟢
687 K Maximum Sums 🟠
688 Minimum Adjacent Swaps to Palindrome 🔴
690 Communication Towers 🟠
691 Skydivers 🟠 cpp
696 Planar Edges 🔴
697 Largest Equivalent Set of Pairs 🔴
698 Largest K Sublist Sum 🟠
699 Skip Tasks to Minimize Work 🟠 py
700 Shortest Common Supersequence 🔴 cpp
701 Making Change Trequel 🟠
702 Job Scheduling to Maximize Profit 🔴
703 Largest Square Matrix with Same Value 🔴 py
706 Circular Longest Increasing Subsequence 🔴
707 Count Square Submatrices 🟠 py
709 Stepping Numbers 🟠
710 K Maximum Non Overlapping Sums 🔴
714 Ugly Number 🟢 cpp
715 Ugly Number Sequel 🟠
718 Divisible Numbers 🔴
719 Minimum Sum Subsequence 🟠
720 Longest Sign Alternating Subsequence 🟠 py
721 ABC Subsequences 🟠
722 K Distinct Window 🟠 py
723 Social Distancing 🟢 py
724 Optimal Decrement 🟠 py
725 Particular Paths 🔴
726 Inverted Inversions 🔵
728 Maximum Sum Removing K Numbers From Ends 🟠 cpp
735 Substringify 🟢 cpp
736 Second Place 🟠 cpp
737 Odd Longest Increasing Subsequence 🔴
738 Special Nodes 🔵
741 Count Next Element 🟢 py
746 Only Child 🟠 cpp
747 Changing Directions 🟢 cpp
748 Verify Max Heap 🟢 py
756 Tree Coloring 🟠 py
759 Stacks 🟠 py
763 Reverse Sublists to Convert to Target 🟢 py
767 Just Average 🟢 cpp
772 Bit Sum 🟠
773 Social Distancing 2 🔴
774 Low Score 🔵
779 Chain of Blocks 🟠
780 Equalize List 🟠
781 Min Max Sets 🟠
783 Minimum String 🟢 cpp
784 One Interval 🟠
785 Chosen N 🔴
786 Strings Down Under 🔵
792 K Longest Show Durations 🟢 py
793 Forest Detection 🟠
795 Group Points 🟠
797 Binary Matrix Leftmost One 🟠 py
798 Unique Fractions 🟢 py
799 Scrum Journeyman 🟠
802 Color Map 🟠
803 Maximal Expression 🔴
804 Minimal Submatrices 🔵
805 Intervals Intersecting at Point 🟢 py
806 Non Consecutive String 🟠
809 Revolving Door 🟢 py
817 Bus Stop 🟠
818 Longest Sublist with Value Range Condition 🟠
819 Most Frequent Number in Intervals 🟢 py LineSweep
820 Beer Bottles 🟢 cpp
821 Cut Palindrome 🟠
822 K Lexicographically Smallest Subsequence 🔴
823 Connect Forest 🔵
830 Large to Small Sort 🟢 cpp
834 Coincidence Search 🟢
835 Set Split 🟠 py
836 Group the Ones 🟠
839 Excel Spreadsheet 🟠
841 Unique Integers in Sorted List 🟢 cpp
848 Grammar Rules 🟠 py
849 Increasing Subsequences of Size K 🔴
850 Take All 🔵
864 Every Pair of Absolute Difference 🟠
865 Furthest From Origin 🟢 cpp
866 Flipped Matrix Prequel 🟢
868 Diagonal Tree Traversal 🟠 cpp
870 Flip to Zeros 🟢 cpp
871 Latin Square Solver 🟠
874 Area Under Histogram 🔴 py Increasing Stack
875 Hill Maker 🟠
876 Hop Cost 🔴
879 Split List 🟢 cpp
881 Making Pairwise Adjacent Sums Small 🟠
882 Wildfire Sequel 🔴
883 Equation Typo 🔵
886 Contained Interval 🟢 py
891 Valid State of List 🟠
893 Lossy Run Length Encoding 🟠
894 Turn Into Non Increasing List 🔴
896 Palindrome Splitting 🟠 py
897 ZigZag Path 🟠
898 Lexicographically Bigger String 🟠 py
899 Fibonacci Subset Sum 🟠 py
901 Resum to Target List 🟠
904 Making List Values Equal 🟢 cpp
905 Finding Binary Search in a String 🟢
906 Paying Workers With Coins 🟠
917 Wallstreet Bets 🟠 py
918 Partition String 🔴 py
919 Word Concatenation 🟠
920 K Divisible Sublist 🟠
921 List Splitting to Consecutive Subsequences 🔴
925 Distinct Islands 🔴 cpp
926 Largest Difference Between Node and a Descendant 🟠
928 Hop Cost Sequel 🟠
929 Tree Sum Count 🟠
930 Kth Missing Number 🟠 cpp
932 Binary Tree Nodes Around Radius 🟠
933 Repeated String Replacement to Target 🔴
935 Maximum of the Smallest Chunk 🔴
936 Multiset Sum 🟠 cpp
937 Collecting Coins Trequel 🔴
938 Knight Moves to Target Coordinate 🟠
939 Subsequence Match Target 🟠
940 Maximum Sum Rectangle with Condition 🔴 py
942 Minimum Number of Contiguous K Flips 🔴 py
943 Longest Interval Containing One Number 🟢 cpp
944 K Stack Pops 🟠
948 Column Flips to Target 🟠
950 Surrounded Islands 🟠 cpp
951 Max Sum of Two Non Overlapping Lists 🟠 cpp
952 Two Non Overlapping Lists With Target Sums 🟠
953 Shortest Path by Removing K Walls 🔴
954 Equal Partitions 🟠 py
956 Largest Sum of 3 Non Overlapping Sublists 🔴 py
957 Sum of Digit Paths in a Tree 🟠 cpp
958 Longest Sublist with Absolute Difference Condition 🟠
959 Largest Island Area 🟠 cpp
960 Smallest Window Subsequence 🔴
961 Parallel Coin Collection 🔴
964 Candy Race Sequel 🔴
965 Probability Game 🔴
966 Group Integers 🟢 py
967 Repeated K Length Substrings 🟢 py
969 Frogger 🔴
970 Candy Race Trequel 🔴
975 Linked List Jumps 🟢 cpp
976 Separate Predators 🟠
977 Minimum Adjacent Elements 🔴
980 Unlock Rooms 🟠 py
981 Binary Search Tree Typo 🔴 py
982 Matrix Nearest Zero 🟠
984 Minimum Number of Transfers to Settle Debts 🔴
985 Largest Island After Land Cell Addition 🔴
986 Image Intersection 🟠
987 Repeated Deletion Sequel 🟠 py
988 Longest Substring with Character Count of at Least K 🟠
989 Minimum Tree From Leaves 🟠
990 Distinct Coin Sums 🟠
991 Edit Distance Sequel 🔴
992 Maximum Points From Removals 🔵
993 Collecting Coins Sequel 🔴
996 A Flight of Stairs Sequel 🟠
1001 Sum of Three Numbers Less than Target 🟠 java
1002 Inverted Subtree 🟢
1004 Concatenated Sums 🟠
1005 Blocks to Spell Word 🟠
1007 Delete From the Ends and Reinsert to Target 🟠
1008 Package Matching 🔴
1015 Candy Race with Different Types 🟠 py
1016 Number of K Divisible Sublists 🟠
1018 Number of K Length Sublists with Average at Least Target 🟠 py
1019 Partition List to Pairs that Are Divisible by K 🟠
1020 Minimum Number of Operations to Make Lists Increasing 🟠
1021 Costly Flight of Stairs 🟠
1022 Largest Average of Sublist with Length at Least K 🔴
1024 Maximum Adjacent Absolute Value Sum After One Reversal 🔴
1025 Append Numbers to List to Create Range 🔴
1026 Column Flips to Maximum Number of Equal Rows 🟠
1027 Partition Lists to Make Sorted List 🟠
1028 Recursive Parentheses Reversal 🔴
1029 Longest Strictly Increasing Then Decreasing Sublist 🟠 py
1030 Create Palindrome After Deleting at Most K Characters 🔴 cpp
1031 Minimum Size of Two Non Overlapping Intervals 🟢
1032 Gene Mutation Groups 🟠
1033 Remove Sublist to Reach Equilibrium 🟠
1034 Minimum Number of Flips to Have Alternating Values 🔴
1037 Prison Cells 🟠
1042 Longest Inequality Alternating Sublist 🟠
1043 Shortest Distance Between Two Points 🔵
1044 Maximum Additive Score by Removing Numbers 🟠
1045 Arrange Symbols to Create Sum 🟠
1046 Missing Numbers From 1 to N 🟢 cpp
1047 Recover Order on Queue of People 🟠
1048 Minimum Difference of Extremes 🟠
1049 Number of Fractions that Sum to 1 🟠
1050 Longest Concatenated String 🟠
1051 Largest Distance Pair 🟠
1053 Separate People Given Dislike Relations 🟠 py
1060 Subsequence Concatenation to Target 🟠
1061 Flip and Invert Matrix 🟢 py
1062 Fair Pay Sequel 🔴
1063 Decode List Message 🔴 py
1064 Longest Prefix that Is a Suffix 🔴
1068 Connect Sticks 🟠
1069 Most Occurring Number After K Increments 🟠
1070 In Place Move Zeros to End of List 🟢 cpp
1072 Circular Greater Element to the Right 🟠 py
1073 Kth Permutation Sequence 🔴
1074 Team Voting 🟠
1075 Profitable Job Matching 🟠 py
1079 Count Rectangular Submatrices 🔴 py
1081 Counting Maximal Value Roots in Binary Tree 🟢 cpp
1084 Shortest Majority Substring 🟢
1086 Deleting Repeated Integers Game 🟠 py
1087 Counting K Length Paths on Binary Tree 🟠
1091 Matrix Prefix Sum 🟢 cpp
1092 Maximize the Minimum Value After K Sublist Increments 🟠
1093 Maximize the Number of Equivalent Pairs After Swaps 🟠
1094 Maximal Points From Deleting Two Character Substrings 🔴
1095 Repeating Numbers 🔴
1100 Largest Sum of Non Adjacent Numbers in Circular List 🟠
1101 Shortest Cycle Containing Target Node 🟠
1103 Partition Zero One Trees 🟠
1104 Longest Equivalent Sublist After K Increments 🟠
1105 Graph Weight Queries 🔴
1106 Even Frequency 🟢 cpp
1108 Sum of Four Numbers Less Than Target 🟠
1109 Lowest Sum of Pair Larger than Target 🟠 cpp
1111 Smallest Pair Sum with Distance Constraint 🟢
1113 Delete Repeated Characters with Costs 🟠 py
1118 Minimum Time to Finish K Tasks 🟠
1119 Maximum XOR Queries 🔴
1120 Pair Matches Larger Than Target 🟠
1121 Smallest Intersecting Element 🟠 cpp, py
1122 Removing Palindromic Sublists 🔴
1123 Largest Sum After K Negations 🟢 cpp
1124 Next Smaller Permutation 🟠
1125 Longest Substring with Even Vowel Counts 🔴
1126 Longest Sublist of 1s After K Sets 🟠 cpp
1127 Lexicographically Smallest Non Palindromic String 🟠 cpp
1128 Concatenated String of Unique Count 🟠
1130 Polyglot Contest 🟠
1131 Decode Messages Sequel 🔴
1132 Longest Fibonacci Subsequence 🟠
1135 Word Machine 🟢 java
1136 Every Sublist Containing Unique Element 🟠
1137 Sum of Three Numbers Trequel 🟠
1138 Sublists Containing Maximum and Minimum 🔴
1152 Win After Last Round 🟢
1154 Consecutive Wins 🟠
1155 Tag Game in a Tree 🔴
1157 Double String Concatenation 🟠
1159 Least Recently Used Cache 🟠
1160 Least Frequently Used Cache 🔴
1161 Minimum Stack 🟢 cpp
1162 Zipped Iterator 🟠 cpp
1163 Rolling Median 🔴
1164 Binary Search Tree Iterator 🟠 cpp
1166 Maximum Stack 🔴
1167 Two Dimensional List Iterator 🟠 py
1168 Peekable Iterator 🟠 py
1169 Run Length Decoded String Iterator 🟢 cpp
1170 Trie 🟠 py
1171 Hit Counter 🟠 cpp
1172 Lexicographic Combination Iterator 🟠
1173 Sum of Two Numbers Online Version 🟢 cpp
1174 Hash Table 🟢 cpp
1176 Set 🟢 cpp
1177 Search Engine 🟠
1178 Incrementable Stack 🟠
1182 Equalize List Sums with Minimal Updates 🟢 cpp
1183 Cut Rods for Profit 🟠
1184 Collecting Disappearing Coins 🟠
1185 Pick Up Gold in Two Locations 🔴
1186 Web Browser 🟠 cpp
1187 Unique Numbers From Sublist Bitwise ORs 🟠
1188 Minimum Initial Value for Positive Prefix Sums 🟢 cpp
1190 Check if Number Is Perfect Square 🟢 cpp
1191 Maximum Number After One Swap 🟠
1192 Distinct Subsequences 🔴
1193 K Distinct Sublists 🔴
1194 Arithmetic Sequence Permutation 🟢 py
1195 Historical Map 🟠
1196 Delete Characters to Equalize Strings 🟠 cpp
1197 Triple Inversion 🔴
1198 Fixed Point 🟢 cpp
1199 Playlist Count 🔴
1200 Prefix with Equivalent Frequencies 🔴
1201 Shortest Sublist With Max Frequency 🟢 py
1202 Binary Search Tree Iterator Sequel 🟠
1203 Frequency Stack 🔴 py
1204 Split String Into K Palindromes 🔴 py
1205 Matrix Rectangular Sums 🟠
1206 Number of Islands Online Version 🔴
1208 Closest Distance to Character 🟢 cpp
1214 Minimize Amplitude After K Removals 🟢
1215 Randomized Binary Search 🟠
1216 K Distinct Groups 🟠
1218 Piece Grouping 🟠
1219 Sum of Odd Length Medians 🔴
1229 Removing Enclosed Parentheses 🟠
1231 Cheapest Bus Route 🔴
1232 Cheapest Cost to All Cities 🔴
1234 Removing Triple Successive Duplicates 🟢 py
1238 Task Run 🟢
1239 Highest Volume Stocks 🟠 cpp
1242 Non Overlapping Pairs of Sublists 🟠
1247 Monotonous String Groups 🟢
1251 Window Queries 🟠
1252 Walled Off 🔴
1253 Peak Heights 🟠
1254 Convert Binary Matrix to Zero Matrix 🔴
1255 Range Query on a List 🟢 cpp PrefixSum
1256 Range Query on Two Dimensional List 🟠 cpp
1257 Range Query on a List Mutable 🟠
1258 Turtle of Wall Street 🟢 java
1259 Max Multiplied Pairings 🟢
1260 Ball Moves 🟠
1261 Minimum Light Radius 🔴
1262 Lazy Run Length Decoding 🟠
1263 Cycle Detection in a Matrix 🔴 py
1264 Split String with Same Distinct Counts 🟠 py
1265 Number Stream to Intervals 🔴
1266 Shortest Sublist to Remove to Make Sorted List 🟠
1267 Number of Decrements to Reach Zero 🔴
1268 Almost Same Strings 🟠 py
1269 Remove Duplicates Occurring More Than Twice 🟠 cpp
1270 Sum of Two Numbers with Sorted List 🟢 cpp
1271 Quadratic Application 🟠 py
1272 Circular Cyclic Loop 🟠
1273 Longest 1s After One Flip 🟠 py
1274 Stuck Keyboard 🟢 cpp
1275 Binary Sublist with Target Sum 🟠
1276 Sum of Two Numbers Less Than Target 🟢 cpp
1277 Balance the Directions 🟠
1278 Split List to Minimize Largest Sum 🔴 cpp
1280 Bounded Robot Moves 🟠
1282 Longest Repeating Sublist After K Updates 🟢
1283 Remove Smaller Coordinates 🟠
1285 Job Scheduling to Minimize Difficulty 🔴
1286 CPU Scheduling 🟠
1287 Nearest Bus Stop From a House 🟠
1288 Unique String Split 🟠
1291 List Partitioning with Inequality Relation 🟠 py
1292 Kth Pair Distance 🔴
1293 Longest Repeating Substring 🟠
1294 Adjacent Square Sums 🔴
1295 Delete Integers In Ascending Order 🔴
1296 Max XOR of Two Integers 🟠
1298 Smallest Number With No Adjacent Duplicates 🟢 java
1299 Non Adjacent Combination Sum 🟠
1300 Sublist with Largest Min Length Product 🔴
1301 Race to Finish Line 🔴
1302 First to Count to Target 🟠 cpp
1303 Unique String Frequencies 🟠 py
1309 Lexicographically Largest Mountain List 🟢 java
1310 Reverse Equivalent Pairs 🟠
1311 Half Monotonous String 🟠
1312 Unique Paths to Go Home 🔴
1313 Recover Original List From Subsequences 🟠
1314 Largest Pair of Points 🟢
1315 Tree Shifting 🟠
1316 Logically Consistent Book 🔴
1318 Sum Pairs to Target 🟠 cpp
1319 Equivalent Folded Sums 🟠
1320 Minimize Amplitude After Operations 🔴
1321 Minimum Removals to Make Mountain List 🔴
1322 Lowest Common Ancestor of List of Values 🟠
1327 Equalize Even and Odd Index Sums 🟠
1328 Lexicographically Smallest String of Distance K 🟠 py
1329 Number of Operations to Decrement Target to Zero 🟠
1330 Lexicographically Smallest Leaf to Root Path 🟠
1331 Enclosed Islands 🟠 cpp
1332 Tree Detection 🟠
1333 Split Tree to Maximize Product 🟠 cpp
1334 Minimum Updates to Make Bitwise OR Equal to Target 🟠 py
1335 Find a Linked List in a Binary Tree 🔴
1336 Bitwise AND of Range of Numbers 🟠 py
1338 Rate Limiter 🟢 py
1339 Flight Scheduling 🟠
1340 Crush Numbers 🟠
1341 Meeting Schedule For Two People 🟠 py
1342 Angry Owner 🟠
1343 Eat Bananas in K Hours 🟠 py
1344 Permute to Make List Larger 🟠
1345 Sum of Two Numbers in BSTs 🟠 cpp
1346 Earliest Uniques in a Stream 🟠 py
1347 Sliding Window Product 🟠
1348 Maximize Roster Rating 🟠
1350 Crush Consecutive Numbers 🔴
1351 Next Greater Element of a Linked List 🟠
1352 Enlarge BST 🟠 cpp
1353 Max Sum Partitioning 🟠
1354 Every Sublist Min Sum 🟠
1355 Count Nodes in Complete Binary Tree 🟠 cpp
1356 Number of K Divisible Pairs 🟠
1357 String Equivalence Relations 🟠 py
1358 Airplane Seat Shuffling 🟠 cpp
1359 Maximize Social Distancing 🟢 cpp, py
1360 Multiple Coin Flips 🟠
1361 Append List to Sum Target 🟢 cpp
1362 Cluster Management 🟠
1364 Fruit Basket Packing 🟠
1365 Toggle Bitwise Expression 🔴
1366 Vertical Lines in Binary Tree 🟢 cpp
1367 Largest Kth Value of List 🟠
1368 Common Reachable Node 🟠
1369 Minimize Absolute Difference of Three Numbers 🟠
1370 Virtual Array 🔴
1371 Tree with Distinct Parities 🟢 cpp
1372 Connect Cartesian Coordinates 🟠 py
1373 Index with Equal Left and Right Sums 🟢 cpp
1374 Update List Sum Closest to Target 🟠
1375 Square Submatrix Sum Below Target 🟠
1376 Longest Arithmetic Subsequence with Difference Constraint 🟠 py
1377 Update List to Make It Strictly Increasing 🔴
1378 Minimize Amplitude After Deleting K Length Sublist 🟢 py
1379 Arithmetic Sequence Queries 🟠
1380 Number of Sublists That Don't Contain Target List 🟠
1381 Shortest Window Substring in Order 🔴
1382 Count Contained Intervals 🟠
1383 File System 🟠 py
1384 Complete an Arithmetic Sequence 🟢 cpp
1385 Underground Tunnel 🟠 py
1386 Ancestor Queries 🔴
1387 XOR Range Queries 🟠 py
1388 Number of Sublists With Small Left Value 🔴 py
1389 Largest Binary Search Subtree in Value 🔴 py
1390 Contiguously Increasing Numbers 🟠 py
1391 Make Target List with Increment and Double Operations 🟠
1392 Sum of Nodes with Even Grandparent Values 🟠 cpp
1393 Vertical Word Arrangement 🟠 py
1394 Remove Half of the List 🟠 py
1395 Minimum Starting Nodes to Visit Graph 🟠 py
1396 Minimum Dropping Path Sum 🟠 cpp
1397 Minimum Dropping Path Sum With Column Distance Constraint 🟠 cpp
1398 Largest Elements in Their Row and Column 🟢 py
1399 Permutations to Generate Binary Search Tree 🔴
1400 Three Way String Split with Equal Ones 🟠
1402 Maximize Binary String Score 🟢 py
1403 Next Node on Its Right 🟠 cpp
1404 Number of Sublists With Odd Sum 🟠
1405 Place Zeros Above the Matrix Diagonal 🟠
1406 Leaf Pairs Less Than Target Distance Away 🟠
1407 Count Substrings With All 1s 🟠 cpp
1408 Equivalent Pairs 🟢 py
1409 Sum of Sublist Range Sum 🔴
1410 Candy Race Taking Square Candies 🔴
1411 Length of the Longest Path in an N Ary Tree 🟠
1412 Manipulate Bits to Zero 🔴
1413 Path to Maximize Probability to Destination 🟠
1414 Delete Sublist to Make Sum Divisible By K 🟠
1415 Maximum Product Path in Matrix 🟠
1416 Permute List to Make Largest Range Sum 🟠 py
1417 Word Distance Queries 🟠
1418 Tic Tac Toe 🟠 py
1419 Stock Span 🟠
1420 Maximum Unique Sublist Sum 🟠 py
1421 Three Player Coin Game 🟠 py
1422 Kth Largest Numbers From Stream 🟠
1423 Number of Moves to Capture the King 🟠
1424 Recursive Voting 🟠
1425 Maximum Dropping Path Sum With Column Distance Cost 🔴
1426 Number of Concatenations to Create Subsequence 🟠
1427 Unobstructed Buildings 🟢 cpp
1428 Number of Substrings with Single Character Difference 🟠
1429 Distinct Substrings 🟠 cpp
1432 Stack of Stacks 🔴
1433 Continuous Path to Escape Mines 🔴
1434 Replace Linked List on Index 🟠 cpp
1435 Middle Operable Deque 🟠
1436 Sort List by Hamming Weight 🟢 py
1437 Circular Queue 🟠 cpp
1438 Maximum Length of Sublist with Positive Product 🟠
1439 Snapshottable List 🟠
1440 Number of Sublists with Max in Interval 🟠
1441 Rank of a Matrix 🔴
1442 Trail to Minimize Effort 🟠
1443 Reduce Binary Number to One 🟠
1444 Subtree with Maximum Average 🟠 cpp
1445 Swap Characters Once to Minimize Differences 🟠
1446 Consecutive Ones 🟢 cpp
1447 Window Limits 🟠
1448 Intersecting Lines 🔴
1449 Search in a Virtually Complete Binary Tree 🟢 cpp
1450 Compressed Vector Product 🟠 py
1452 Fix Flight Itinerary 🔴
1453 Virtual Boolean Array 🟠 py
1454 Kth User to Visit Website 🟠
1455 Bulk Shift Letters 🟠 py
1456 Sort List by Reversing Once 🟠 cpp
1457 Unique People in Contact List 🟢 py
1458 View Over People 🟠
1459 Kth Largest Pair Product 🔴
1460 ASCII String to Integer 🟢 py
1461 Characters in Each Bracket Depth 🟠 py
1462 Longest Consecutive Sublist 🟠
1463 Split Digits to Sum Closest To Target 🔴
1464 Mutual Followers 🟢 cpp
1465 Virtually Cloneable Stacks 🟠 py
1468 Cut Ribbons of Same Length 🟠 py
1469 Next Permutation From Pool 🔴
1470 5 Star Review Percentage 🟢 cpp
1471 Stock Order Execution 🟠
1472 Maximize Rook Square Values 🔴
1473 Max Product of Three Numbers 🟢 cpp
1474 Bounded Square Sums 🟠
1475 Point Distances with Shared Coordinate 🟠
1476 Towers Without a Valley 🔴
1477 First Fit Room 🟢 java
1478 Rotate a Box Under Gravity 🟠 py
1479 Last Value Map 🟠
1480 Number of Monotonically Increasing Lists 🔴
1482 Maximum Absolute Value of Sublist 🟠 cpp
1484 Number of Non Overlapping Sublists With Sum of Target 🟠
1485 K Numbers Greater Than or Equal to K 🟢 cpp
1486 Max Multiplied Pairings Sequel 🟠
1487 Integer to Roman Numeral 🟠 py
1488 Longest Palindrome From Concatenating Two Subsequences 🔴
1492 Largest One Submatrix with Column Swaps 🟠
1493 Shortest Path in a Graph 🟠
1494 Swap Kth Node Values 🟠 cpp
1495 Equivalent Product Pairs 🟠
1497 Integer to English 🔴
1498 Shift to Create Range 🟢 cpp, py
1499 Remove Smallest Peaks in Order 🟠
1501 Traverse Coordinates 🔴
1502 Matrix Relations 🔴
1503 Pair Sums to Power of Two 🟢 cpp
1504 Dropped Sensor Metric 🟠 cpp
1505 Drop a Ball Down the Stairs 🟠
1506 Shortest Absolute Value Distance 🟠
1507 Sustainable Consumption 🔴
1508 Generate Anagram Substrings 🟢
1511 Visible Blocks 🔴
1513 Noisy Palindrome 🟢 py
1514 Intersection of Two Maps 🟠
1515 Longest Consecutively Increasing Substring 🟠
1516 Connected Road to Destination 🔴
1517 Find Local Peaks 🟢 cpp
1519 Ambigram Detection 🟠
1520 Weighted Merge Interval 🟠
1521 Minimize Maximum Stadium Size 🔴
1522 Strictly Alternating List 🟢 py
1524 Interval Painting 🟠
1525 Blocked Pipeline 🟠
1526 Best Currency Path 🔴
1527 Insert Into Linked List 🟢 cpp
1528 Subtree with Maximum Value 🟠 cpp
1530 Longest Matrix Path Length 🟠
1531 Ticket Order 🔴
1532 Pair and Triples 🟢 py
1533 Find Local Peaks Sequel 🟠
1534 Longest Arithmetic Sequence Tree Path 🔴
1535 Longest Prefix Sequence 🟠
1536 Validate Delivery Orders 🟢 py
1537 Log Truncation 🟠 py
1538 Brick Layout 🟠
1539 Border Crossing 🔴

About

solutions to coding problems at https://binarysearch.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 54.5%
  • Python 41.2%
  • Java 4.2%
  • Shell 0.1%