Leetcode-Ruby

November 2, 2022 · View on GitHub

Leetcode Solutions in Ruby

Please give this repo a ⭐ if it inspires you.

Easy

LC #Description
1108Defanging an IP Address
938Range Sum of BST
1614Maximum Nesting Depth of the Parentheses
1832Check if the Sentence Is Pangram
21Merge Two Sorted Lists
141Linked List Cycle
20Valid Parentheses
617Merge Two Binary Trees
897Increasing Order Search Tree
346Moving Average from Data Stream
1748Sum of Unique Elements
1351Count Negative Numbers in a Sorted Matrix
905Sort Array By Parity
344Reverse String
1460Make Two Arrays Equal by Reversing Sub-arrays
104Maximum Depth of Binary Tree
977Squares of a Sorted Array
226Invert Binary Tree
1047Remove All Adjacent Duplicates In String
206Reverse Linked List
496Next Greater Element I
136Single Number
463Island Perimeter
349Intersection of Two Arrays
637Average of Levels in Binary Tree
1002Find Common Characters
509Fibonacci Number
766Toeplitz Matrix
704Binary Search
1160Find Words That Can Be Formed by Characters
412Fizz Buzz
266Palindrome Permutation
145Binary Tree Postorder Traversal
169Majority Element
242Valid Anagram
217Contains Duplicate
283Move Zeroes
1260Shift 2D Grid
700Search in a Binary Search Tree
706Design HashMap
844Backspace String Compare
191Number of 1 Bits
1480Running Sum of 1d Array
160Intersection of Two Linked Lists
88Merge Sorted Array
1332Remove Palindromic Subsequences
1925Count Square Sum Triples
859Buddy Strings
118Pascal's Triangle
557Reverse Words in a String III
1137N-th Tribonacci Number
976Largest Perimeter Triangle
219Contains Duplicate II
645Set Mismatch
1662Check If Two String Arrays are Equivalent
1929Concatenation of Array

Medium

LC #Description
78Subsets
82Remove Duplicates from Sorted List II
138Copy List with Random Pointer
946Validate Stack Sequences
316Remove Duplicate Letters
763Partition Labels
1007Minimum Domino Rotations For Equal Row
991Broken Calculator
1663Smallest String With A Given Numeric Value
881Boats to Save People
81Search in Rotated Sorted Array II
287Find the Duplicate Number
74Search a 2D Matrix
1721Swapping Nodes in a Linked List
11Container With Most Water
538Convert BST to Greater Tree
230Kth Smallest Element in a BST
535Encode and Decode TinyURL
284Peeking Iterator
341Flatten Nested List Iterator
216Combination Sum III
47Permutations II
743Network Delay Time
1302Deepest Leaves Sum
1461Check If a String Contains All Binary Codes of Size K
167Two Sum II - Input Array Is Sorted
3Longest Substring Without Repeating Characters
1658Minimum Operations to Reduce X to Zero
1695Maximum Erasure Value
120Triangle
583Delete Operation for Two Strings
1048Longest String Chain
5Longest Palindromic Substring
820Short Encoding of Words
215Kth Largest Element in an Array
1570Dot Product of Two Sparse Vectors
339Nested List Weight Sum
1382Balance a Binary Search Tree
1762Buildings With an Ocean View
665Non-decreasing Array
1423Maximum Points You Can Obtain from Cards
199Binary Tree Right Side View
102Binary Tree Level Order Traversal
105Construct Binary Tree from Preorder and Inorder Traversal
92Reverse Linked List II
236Lowest Common Ancestor of a Binary Tree
114Flatten Binary Tree to Linked List
86Partition List
34Find First and Last Position of Element in Sorted Array
890Find and Replace Pattern
307Range Sum Query - Mutable
240Search a 2D Matrix II
62Unique Paths
1457Pseudo-Palindromic Paths in a Binary Tree
113Path Sum II
622Design Circular Queue
990Satisfiability of Equality Equations
19Remove Nth Node From End of List
658Find K Closest Elements
91Decode Ways
1578Minimum Time to Make Rope Colorful
163Sum Closest
1328Break a Palindrome
653Two Sum IV - Input is a BST
334Increasing Triplet Subsequence
2095Delete the Middle Node of a Linked List
38Count and Say
1239Maximum Length of a Concatenated String with Unique Characters
523Continuous Subarray Sum
49Group Anagrams
433Minimum Genetic Mutation

Hard

LC #Description
410Split Array Largest Sum
32Longest Valid Parentheses
968Binary Tree Cameras
76Minimum Window Substring
2136Earliest Possible Day of Full Bloom