id int64 1 2k | content stringlengths 272 88.9k | title stringlengths 3 77 | title_slug stringlengths 3 79 | question_content stringlengths 230 5k | question_hints stringclasses 695
values | tag stringclasses 618
values | level stringclasses 3
values | similar_question_ids stringclasses 822
values |
|---|---|---|---|---|---|---|---|---|
851 | hello welcome today let's solve the liquid problem 851 loud and Rings let me explain the problem a little bit because some of people don't like this problem because they don't understand it so actually it is a very good question and yeah it is a very good question to practice the political thought if you can use DFS yo... | Loud and Rich | goat-latin | There is a group of `n` people labeled from `0` to `n - 1` where each person has a different amount of money and a different level of quietness.
You are given an array `richer` where `richer[i] = [ai, bi]` indicates that `ai` has more money than `bi` and an integer array `quiet` where `quiet[i]` is the quietness of th... | null | String | Easy | null |
110 | okay leak code 110 balanced binary tree in this problem you're given a root of a binary tree and you want to find out if it's balanced or not and they're kind enough to give us a definition of what it means for a tree to be balanced and it basically says a binary tree in which the left and right subtrees of every node ... | Balanced Binary Tree | balanced-binary-tree | Given a binary tree, determine if it is **height-balanced**.
**Example 1:**
**Input:** root = \[3,9,20,null,null,15,7\]
**Output:** true
**Example 2:**
**Input:** root = \[1,2,2,3,3,null,null,4,4\]
**Output:** false
**Example 3:**
**Input:** root = \[\]
**Output:** true
**Constraints:**
* The number of nodes ... | null | Tree,Depth-First Search,Binary Tree | Easy | 104 |
939 | hello and welcome back to the cracking fang youtube channel today we're going to be solving lead code problem 939 minimum area rectangle before we get into the problem i just want to ask you to please subscribe to my channel i have the goal of hitting a thousand subscribers by the end of may and i really need your help... | Minimum Area Rectangle | valid-permutations-for-di-sequence | You are given an array of points in the **X-Y** plane `points` where `points[i] = [xi, yi]`.
Return _the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes_. If there is not any such rectangle, return `0`.
**Example 1:**
**Input:** points = \[\[1,1\],\[1,3\],\[3,1\],\[3,3\]... | null | Dynamic Programming | Hard | null |
1,283 | Ajay Ko Hello brother Manish Album Polling So the question we are going to discuss today is the report of a fungus moisturizer. Is it ok? So I would just like to make a request to you to make the previous question positive. Please read that question along with this question and then you will understand that both the qu... | Find the Smallest Divisor Given a Threshold | reformat-date | Given an array of integers `nums` and an integer `threshold`, we will choose a positive integer `divisor`, divide all the array by it, and sum the division's result. Find the **smallest** `divisor` such that the result mentioned above is less than or equal to `threshold`.
Each result of the division is rounded to the ... | Handle the conversions of day, month and year separately. Notice that days always have a two-word ending, so if you erase the last two characters of this days you'll get the number. | String | Easy | null |
416 | Hello hello guys welcome video question polytechnic subscribe this Video give a like and subscribe the Video then subscribe to The Amazing spider-man 2 The Amazing spider-man 2 The Amazing spider-man 2 Bhilawe Chameli b.a. Bhilawe Chameli b.a. Bhilawe Chameli b.a. That and protect the sum of the values into this That... | Partition Equal Subset Sum | partition-equal-subset-sum | Given an integer array `nums`, return `true` _if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or_ `false` _otherwise_.
**Example 1:**
**Input:** nums = \[1,5,11,5\]
**Output:** true
**Explanation:** The array can be partitioned as \[1, 5, 5\] and \[11\].
**E... | null | Array,Dynamic Programming | Medium | 698,2108,2135,2162 |
224 | Hello Everyone Welcome to Remember Write 4 Injured S Question A specific letter to or in this question in word given in the expression and always at expression and only in the country in the states that you will know Reports of Operators Water Possible Plus Minus * Multiplication Division Minus * Multiplication Divisio... | Basic Calculator | basic-calculator | Given a string `s` representing a valid expression, implement a basic calculator to evaluate it, and return _the result of the evaluation_.
**Note:** You are **not** allowed to use any built-in function which evaluates strings as mathematical expressions, such as `eval()`.
**Example 1:**
**Input:** s = "1 + 1 "
**O... | null | Math,String,Stack,Recursion | Hard | 150,227,241,282,785,2147,2328 |
119 | all right this leaf code question is called Pascal's triangle - it says given called Pascal's triangle - it says given called Pascal's triangle - it says given a non-negative index K where K is less a non-negative index K where K is less a non-negative index K where K is less than or equal to 33 return the caithe index... | Pascal's Triangle II | pascals-triangle-ii | Given an integer `rowIndex`, return the `rowIndexth` (**0-indexed**) row of the **Pascal's triangle**.
In **Pascal's triangle**, each number is the sum of the two numbers directly above it as shown:
**Example 1:**
**Input:** rowIndex = 3
**Output:** \[1,3,3,1\]
**Example 2:**
**Input:** rowIndex = 0
**Output:** \[... | null | Array,Dynamic Programming | Easy | 118,2324 |
54 | hey everyone welcome back today we are going to solve problem number 54 spiral Matrix first we will see the explanation of the problem statement then the logic and the code now let's dive into the solution so here I've taken the first example from the link website so here we are given a matrix where we need to print th... | Spiral Matrix | spiral-matrix | Given an `m x n` `matrix`, return _all elements of the_ `matrix` _in spiral order_.
**Example 1:**
**Input:** matrix = \[\[1,2,3\],\[4,5,6\],\[7,8,9\]\]
**Output:** \[1,2,3,6,9,8,7,4,5\]
**Example 2:**
**Input:** matrix = \[\[1,2,3,4\],\[5,6,7,8\],\[9,10,11,12\]\]
**Output:** \[1,2,3,4,8,12,11,10,9,5,6,7\]
**Const... | Well for some problems, the best way really is to come up with some algorithms for simulation. Basically, you need to simulate what the problem asks us to do. We go boundary by boundary and move inwards. That is the essential operation. First row, last column, last row, first column and then we move inwards by 1 and th... | Array,Matrix,Simulation | Medium | 59,921 |
1,816 | By talking loot electronic today let whole number 86 which is track court sentenced to pune sentences of list office updated by single screen and reading traveling specific sister in law and order situation appointed by subscribe and subscribe our channel so that Yuvvraj will appoint loot this should see subscribe a fi... | Truncate Sentence | lowest-common-ancestor-of-a-binary-tree-iv | A **sentence** is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of **only** uppercase and lowercase English letters (no punctuation).
* For example, `"Hello World "`, `"HELLO "`, and `"hello world hello world "` are all sentences.
You are given a... | Starting from the root, traverse the left and the right subtrees, checking if one of the nodes exist there. If one of the subtrees doesn't contain any given node, the LCA can be the node returned from the other subtree If both subtrees contain nodes, the LCA node is the current node. | Tree,Depth-First Search,Binary Tree | Medium | 235,236,1218,1780,1790,1816 |
1,200 | hey everybody this is larry this is me doing the code daily challenge day 20. hit the like button hit the subscribe button join me on discord let me know what you think about trey's farm absolute minimum or minimum absolute difference okay so this is the easy problem they say so we should be able to do it right quickly... | Minimum Absolute Difference | remove-interval | Given an array of **distinct** integers `arr`, find all pairs of elements with the minimum absolute difference of any two elements.
Return a list of pairs in ascending order(with respect to pairs), each pair `[a, b]` follows
* `a, b` are from `arr`
* `a < b`
* `b - a` equals to the minimum absolute difference o... | Solve the problem for every interval alone. Divide the problem into cases according to the position of the two intervals. | Array | Medium | null |
1,047 | welcome back to our jess today's question is leak code 1047 remove all adjacent duplicates in string so you're given a string s consistent of lowercase english letters a duplicate removal consists of choosing two adjacent and equal letters and removing them we repeatedly make duplicate removals on s until we no longer ... | Remove All Adjacent Duplicates In String | maximize-sum-of-array-after-k-negations | You are given a string `s` consisting of lowercase English letters. A **duplicate removal** consists of choosing two **adjacent** and **equal** letters and removing them.
We repeatedly make **duplicate removals** on `s` until we no longer can.
Return _the final string after all such duplicate removals have been made_... | null | Array,Greedy,Sorting | Easy | 2204 |
118 | hey everyone today we'll be doing another Elite code 118 pascals triangle one of the most like problems out there and one of my favorite problems uh in this problem we will be given the number of rows for example here number of rows five and we have to make them in a triangle like this note certainly in a triangle but ... | Pascal's Triangle | pascals-triangle | Given an integer `numRows`, return the first numRows of **Pascal's triangle**.
In **Pascal's triangle**, each number is the sum of the two numbers directly above it as shown:
**Example 1:**
**Input:** numRows = 5
**Output:** \[\[1\],\[1,1\],\[1,2,1\],\[1,3,3,1\],\[1,4,6,4,1\]\]
**Example 2:**
**Input:** numRows = ... | null | Array,Dynamic Programming | Easy | 119 |
624 | hey everybody this is Larry this is me doing week four of the Leo premium weekly challenge Max uh hit the like button hit the Subscribe button join me in Discord let me know what you think about this problem 624 maximum distance in the rise you're given M where each ARR is sort in ascending order you can pick up two in... | Maximum Distance in Arrays | maximum-distance-in-arrays | You are given `m` `arrays`, where each array is sorted in **ascending order**.
You can pick up two integers from two different arrays (each array picks one) and calculate the distance. We define the distance between two integers `a` and `b` to be their absolute difference `|a - b|`.
Return _the maximum distance_.
**... | null | Array,Greedy | Medium | null |
283 | hello everyone and welcome to python programming practice in this episode we are going to be tackling lead code number 283 move zeros this is classified as an easy problem we'll start by reading through the description here given an array called nums write a function to move all zeros to the end of it while maintaining... | Move Zeroes | move-zeroes | Given an integer array `nums`, move all `0`'s to the end of it while maintaining the relative order of the non-zero elements.
**Note** that you must do this in-place without making a copy of the array.
**Example 1:**
**Input:** nums = \[0,1,0,3,12\]
**Output:** \[1,3,12,0,0\]
**Example 2:**
**Input:** nums = \[0\]... | In-place means we should not be allocating any space for extra array. But we are allowed to modify the existing array. However, as a first step, try coming up with a solution that makes use of additional space. For this problem as well, first apply the idea discussed using an additional array and the in-place solution ... | Array,Two Pointers | Easy | 27 |
1,332 | before moving forward check out coding interview prep masterclass for preparing for interviews of product based companies it covers 70 plus problem solving patterns asked in top companies with detailed examples use code ioc for 50 off for lifetime access the course is self-created by access the course is self-created b... | Remove Palindromic Subsequences | count-vowels-permutation | You are given a string `s` consisting **only** of letters `'a'` and `'b'`. In a single step you can remove one **palindromic subsequence** from `s`.
Return _the **minimum** number of steps to make the given string empty_.
A string is a **subsequence** of a given string if it is generated by deleting some characters o... | Use dynamic programming. Let dp[i][j] be the number of strings of length i that ends with the j-th vowel. Deduce the recurrence from the given relations between vowels. | Dynamic Programming | Hard | null |
238 | yo what is up youtube today i'm going to be going over a product of a rare except self it's a medium problem on leak code i think a few people have asked facebook yeah this is really popular with facebook and amazon uh this one's a good to know it's like once you see the solution like wow why didn't i think of that um ... | Product of Array Except Self | product-of-array-except-self | Given an integer array `nums`, return _an array_ `answer` _such that_ `answer[i]` _is equal to the product of all the elements of_ `nums` _except_ `nums[i]`.
The product of any prefix or suffix of `nums` is **guaranteed** to fit in a **32-bit** integer.
You must write an algorithm that runs in `O(n)` time and without... | null | Array,Prefix Sum | Medium | 42,152,265,2267 |
935 | hey what's up guys sean here so today like today let's talk about this later called problem number nine hundred and thirty five nights dialer okay so you're given like a night right in a in the chess game so for a night for night II the move can only be a two to the diagonal but with the three by two right so I think m... | Knight Dialer | orderly-queue | The chess knight has a **unique movement**, it may move two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of an **L**). The possible movements of chess knight are shown in this diagaram:
A chess knight can move as indicated in the che... | null | Math,String,Sorting | Hard | null |
81 | Jhaal Hello Hi Guys Welcome To Question Today's Question Is Search Andare To In This Question Being Given In The Arrested In Ascending Order And Irritated Accepted Unknown To You Before Hand For Example 0125 6 Might Vikram 2560 128 Mrs Cost But In This Manner Happy Life More People Two apk file is ok for example C if i... | Search in Rotated Sorted Array II | search-in-rotated-sorted-array-ii | There is an integer array `nums` sorted in non-decreasing order (not necessarily with **distinct** values).
Before being passed to your function, `nums` is **rotated** at an unknown pivot index `k` (`0 <= k < nums.length`) such that the resulting array is `[nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nu... | null | Array,Binary Search | Medium | 33 |
367 | hello friends so today we're gonna discuss a very interesting problem again from a binary search playlist it's also an easy problem so we're gonna first cut two three easy problems and then we moved on to the difficult medium and hard problems so i have already uploaded one video of an easy problem you can if you haven... | Valid Perfect Square | valid-perfect-square | Given a positive integer num, return `true` _if_ `num` _is a perfect square or_ `false` _otherwise_.
A **perfect square** is an integer that is the square of an integer. In other words, it is the product of some integer with itself.
You must not use any built-in library function, such as `sqrt`.
**Example 1:**
**In... | null | Math,Binary Search | Easy | 69,633 |
1,200 | alright what's up guys hey Nick white here do I do tecnico dang stuff on Twitch in YouTube you can check the description for all my information no it's got everything this is an easy problem called minimum absolute difference we're on number 1200 here so this oh this is a newer one so not a lot of likes but it's pretty... | Minimum Absolute Difference | remove-interval | Given an array of **distinct** integers `arr`, find all pairs of elements with the minimum absolute difference of any two elements.
Return a list of pairs in ascending order(with respect to pairs), each pair `[a, b]` follows
* `a, b` are from `arr`
* `a < b`
* `b - a` equals to the minimum absolute difference o... | Solve the problem for every interval alone. Divide the problem into cases according to the position of the two intervals. | Array | Medium | null |
251 | 251 flat and 2d vector from design an iterator to flatten a 2d vector it should support the next and has operation so based on this question we know this is a design question and you're designing an iterator which is going to be a 2d vector and it has two functions next and has next let's see what each luncheon does th... | Flatten 2D Vector | flatten-2d-vector | Design an iterator to flatten a 2D vector. It should support the `next` and `hasNext` operations.
Implement the `Vector2D` class:
* `Vector2D(int[][] vec)` initializes the object with the 2D vector `vec`.
* `next()` returns the next element from the 2D vector and moves the pointer one step forward. You may assume... | How many variables do you need to keep track? Two variables is all you need. Try with x and y. Beware of empty rows. It could be the first few rows. To write correct code, think about the invariant to maintain. What is it? The invariant is x and y must always point to a valid point in the 2d vector. Should you maintain... | Array,Two Pointers,Design,Iterator | Medium | 173,281,284,341 |
72 | on everyone so today we are looking at lead code number 72 problem called edit distance and this is a very tricky problem especially if you're not familiar with dynamic programming or a method called tabulation if you're unfamiliar with tabulation i highly recommend reviewing it before trying to attempt this problem or... | Edit Distance | edit-distance | Given two strings `word1` and `word2`, return _the minimum number of operations required to convert `word1` to `word2`_.
You have the following three operations permitted on a word:
* Insert a character
* Delete a character
* Replace a character
**Example 1:**
**Input:** word1 = "horse ", word2 = "ros "
**O... | null | String,Dynamic Programming | Hard | 161,583,712,1105,2311 |
76 | hey everyone in this video let's take a look at question 76 minimum window substring only code this is part of our blind 75 list of questions so let's begin in this question we're given two strings s and t of lens M and N respectively and you want to return the minimum window substring of s so that every character in t... | Minimum Window Substring | minimum-window-substring | Given two strings `s` and `t` of lengths `m` and `n` respectively, return _the **minimum window**_ **_substring_** _of_ `s` _such that every character in_ `t` _(**including duplicates**) is included in the window_. If there is no such substring, return _the empty string_ `" "`.
The testcases will be generated such tha... | Use two pointers to create a window of letters in S, which would have all the characters from T. Since you have to find the minimum window in S which has all the characters from T, you need to expand and contract the window using the two pointers and keep checking the window for all the characters. This approach is als... | Hash Table,String,Sliding Window | Hard | 30,209,239,567,632,727 |
213 | The The The next question we're going to do is house address means by adjacent houses our security system and it bill automatically tomorrow please if you adjust and houses and broken in which D se life and interior representing the amount of money of H house return D Maximum amount very you can drop tonight without go... | House Robber II | house-robber-ii | You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are **arranged in a circle.** That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and **it will automatical... | Since House[1] and House[n] are adjacent, they cannot be robbed together. Therefore, the problem becomes to rob either House[1]-House[n-1] or House[2]-House[n], depending on which choice offers more money. Now the problem has degenerated to the House Robber, which is already been solved. | Array,Dynamic Programming | Medium | 198,256,276,337,600,656 |
318 | Ki A Hello Everyone Welcome 2017 Liquid Liner Test Vaishnav Maximum Product Vote Length Inspiration Witch Giveth Anarya Strengths and Weaknesses Different Words Subscribe Skin Ko Subscribe Ki Aunty Cup in Hair Maximum Product Award 318 Ki Shoulder Justice System Chemistry Everybody's Mind Something Like This Point Spri... | Maximum Product of Word Lengths | maximum-product-of-word-lengths | Given a string array `words`, return _the maximum value of_ `length(word[i]) * length(word[j])` _where the two words do not share common letters_. If no such two words exist, return `0`.
**Example 1:**
**Input:** words = \[ "abcw ", "baz ", "foo ", "bar ", "xtfn ", "abcdef "\]
**Output:** 16
**Explanation:** The two ... | null | Array,String,Bit Manipulation | Medium | null |
219 | hello gas myself amrita welcome back tu our channel technosis so in today's video c are going tu discuss leapcoad problem number tu van nine date is content duplicate tu i have already discuss content duplicate in van of de video ill mention de link in de description box u Can check d out as well let's first understand... | Contains Duplicate II | contains-duplicate-ii | Given an integer array `nums` and an integer `k`, return `true` _if there are two **distinct indices**_ `i` _and_ `j` _in the array such that_ `nums[i] == nums[j]` _and_ `abs(i - j) <= k`.
**Example 1:**
**Input:** nums = \[1,2,3,1\], k = 3
**Output:** true
**Example 2:**
**Input:** nums = \[1,0,1,1\], k = 1
**Outp... | null | Array,Hash Table,Sliding Window | Easy | 217,220 |
1,905 | hey there today we'll be doing the question that is of D3 count sub Island and the number of enclaves and all the D1 and D2 videos have already been uploaded please do follow this graph playlist these questions are only from read code 90 okay so you can find this Garden lead group so coming on to D3 Matrix related prob... | Count Sub Islands | design-authentication-manager | You are given two `m x n` binary matrices `grid1` and `grid2` containing only `0`'s (representing water) and `1`'s (representing land). An **island** is a group of `1`'s connected **4-directionally** (horizontal or vertical). Any cells outside of the grid are considered water cells.
An island in `grid2` is considered ... | Using a map, track the expiry times of the tokens. When generating a new token, add it to the map with its expiry time. When renewing a token, check if it's on the map and has not expired yet. If so, update its expiry time. To count unexpired tokens, iterate on the map and check for each token if it's not expired yet. | Hash Table,Design | Medium | null |
421 | Hello hello everyone I had Shiva and the objects ka khana tha interesting problem and liquid vijay maximum chowkpur members in the joint account this problem is clear name par send me to file now pair kushwaha road near the independent swift jump into the solution of maths problem list different Or How To Find The Bahi... | Maximum XOR of Two Numbers in an Array | maximum-xor-of-two-numbers-in-an-array | Given an integer array `nums`, return _the maximum result of_ `nums[i] XOR nums[j]`, where `0 <= i <= j < n`.
**Example 1:**
**Input:** nums = \[3,10,5,25,2,8\]
**Output:** 28
**Explanation:** The maximum result is 5 XOR 25 = 28.
**Example 2:**
**Input:** nums = \[14,70,53,83,49,91,36,80,92,51,66,70\]
**Output:** 1... | null | Array,Hash Table,Bit Manipulation,Trie | Medium | 1826 |
892 | yeah hi hello everyone I'm a programmer today I will introduce to you a math problem about the surface area of a 3d cube. The surface area of a 3d cube. The surface area of a 3d cube. The detailed problem gives us a three-dimensional problem. detailed problem gives us a three-dimensional problem. detailed problem... | Surface Area of 3D Shapes | shortest-subarray-with-sum-at-least-k | You are given an `n x n` `grid` where you have placed some `1 x 1 x 1` cubes. Each value `v = grid[i][j]` represents a tower of `v` cubes placed on top of cell `(i, j)`.
After placing these cubes, you have decided to glue any directly adjacent cubes to each other, forming several irregular 3D shapes.
Return _the tota... | null | Array,Binary Search,Queue,Sliding Window,Heap (Priority Queue),Prefix Sum,Monotonic Queue | Hard | null |
804 | Hello friends welcome to take good bye Nivedita and in this video we are going to solve unique moles code words so what have we been given in this problem statement, here we have been provided a chord of latest from A to Z, okay this code Yours is made up of Dot and A. The list you are seeing here is your code from A t... | Unique Morse Code Words | rotated-digits | International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:
* `'a'` maps to `".- "`,
* `'b'` maps to `"-... "`,
* `'c'` maps to `"-.-. "`, and so on.
For convenience, the full table for the `26` letters of the English alphabet is given below:
\[ ... | null | Math,Dynamic Programming | Medium | null |
1,679 | hello everyone welcome back here is vanams and today we will be diving deep into the problem max number of key soon purse so it's a medium difficulty problem on lead code and trust me it's a interesting one so let's get started here is a brief overview of the problem we have an integer array nums and an integer key and... | Max Number of K-Sum Pairs | shortest-subarray-to-be-removed-to-make-array-sorted | You are given an integer array `nums` and an integer `k`.
In one operation, you can pick two numbers from the array whose sum equals `k` and remove them from the array.
Return _the maximum number of operations you can perform on the array_.
**Example 1:**
**Input:** nums = \[1,2,3,4\], k = 5
**Output:** 2
**Explana... | The key is to find the longest non-decreasing subarray starting with the first element or ending with the last element, respectively. After removing some subarray, the result is the concatenation of a sorted prefix and a sorted suffix, where the last element of the prefix is smaller than the first element of the suffix... | Array,Two Pointers,Binary Search,Stack,Monotonic Stack | Medium | null |
64 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem minimum path sum we are given an m by n grid filled with non-negative numbers we want to find the non-negative numbers we want to find the non-negative numbers we want to find the path from the top left all the way to t... | Minimum Path Sum | minimum-path-sum | Given a `m x n` `grid` filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
**Note:** You can only move either down or right at any point in time.
**Example 1:**
**Input:** grid = \[\[1,3,1\],\[1,5,1\],\[4,2,1\]\]
**Output:** 7
**Explanat... | null | Array,Dynamic Programming,Matrix | Medium | 62,174,741,2067,2192 |
1,269 | hey what's up guys Chung here so today let's take a look at another little problem here 1269 a number of ways to stay in the same place after some steps okay so you're given like two parameters first one is the steps you can take and the second one is the length of this array all right and at each step you can do three... | Number of Ways to Stay in the Same Place After Some Steps | market-analysis-ii | You have a pointer at index `0` in an array of size `arrLen`. At each step, you can move 1 position to the left, 1 position to the right in the array, or stay in the same place (The pointer should not be placed outside the array at any time).
Given two integers `steps` and `arrLen`, return the number of ways such that... | null | Database | Hard | null |
729 | welcome to my YouTube channel I hope you guys are having a wonderful weekend in this video we will look at problem 729 from the code so let's look at this problem so this is another problem where we have I think we have two more similar problems in this series my calendar so I will talk about those two other problems i... | My Calendar I | my-calendar-i | You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a **double booking**.
A **double booking** happens when two events have some non-empty intersection (i.e., some moment is common to both events.).
The event can be represented as a pair of integers `start... | Store the events as a sorted list of intervals. If none of the events conflict, then the new event can be added. | Design,Segment Tree,Ordered Set | Medium | 731,732 |
1,394 | hey guys this is Jay sir in this video I'm going to take a look at 1 3 9 4 find like an integer in an array this is a request from one of my subscribers I think and he asked me to do review on this question so let's do it today we are given an array of integers are integers a lock integer you signature which has a freq... | Find Lucky Integer in an Array | find-lucky-integer-in-an-array | Given an array of integers `arr`, a **lucky integer** is an integer that has a frequency in the array equal to its value.
Return _the largest **lucky integer** in the array_. If there is no **lucky integer** return `-1`.
**Example 1:**
**Input:** arr = \[2,2,3,4\]
**Output:** 2
**Explanation:** The only lucky number... | null | null | Easy | null |
1,091 | hi guys welcome to algorithms made easy in this video we will see the question shortest path in a binary matrix in an n cross n square grid each cell is either empty or blocked a clear path from top left to bottom right has length k if and only if it is composed of cells c of one c of total c of k such that the adjacen... | Shortest Path in Binary Matrix | maximum-average-subtree | Given an `n x n` binary matrix `grid`, return _the length of the shortest **clear path** in the matrix_. If there is no clear path, return `-1`.
A **clear path** in a binary matrix is a path from the **top-left** cell (i.e., `(0, 0)`) to the **bottom-right** cell (i.e., `(n - 1, n - 1)`) such that:
* All the visite... | Can you find the sum of values and the number of nodes for every sub-tree ? Can you find the sum of values and the number of nodes for a sub-tree given the sum of values and the number of nodes of it's left and right sub-trees ? Use depth first search to recursively find the solution for the children of a node then use... | Tree,Depth-First Search,Binary Tree | Medium | 2126 |
916 | welcome to march's leeco challenge today's problem is word subsets you are given two arrays a and b of words each word is a string of lowercase letters now say that word b is a subset of word a if every letter in b occurs in a including multiplicity for example wrr is a subset of warrior because it has one w and two r'... | Word Subsets | decoded-string-at-index | You are given two string arrays `words1` and `words2`.
A string `b` is a **subset** of string `a` if every letter in `b` occurs in `a` including multiplicity.
* For example, `"wrr "` is a subset of `"warrior "` but is not a subset of `"world "`.
A string `a` from `words1` is **universal** if for every string `b` i... | null | String,Stack | Medium | null |
860 | hey everyone welcome back to the channel in today's video we're going to be solving the problem laminate change so the question says at a lemonade stand each and rate costs five dollars customers are standing in a queue to buy from you and order one at a time each customer will only buy one lemonade and pay with either... | Lemonade Change | design-circular-queue | At a lemonade stand, each lemonade costs `$5`. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a `$5`, `$10`, or `$20` bill. You must provide the correct change to each customer so that the net tran... | null | Array,Linked List,Design,Queue | Medium | 859,1767 |
1,529 | The production of today is world seervi ki petrol episode 8 example fair in amlon a meaning target we have this tension 1012 how to behave mobile 0512 initial all the alarms of water pollution open side five times must subscribe ke oppose ke So, if I have come from here till now, then all this side, now what should I d... | Minimum Suffix Flips | max-difference-you-can-get-from-changing-an-integer | You are given a **0-indexed** binary string `target` of length `n`. You have another binary string `s` of length `n` that is initially set to all zeros. You want to make `s` equal to `target`.
In one operation, you can pick an index `i` where `0 <= i < n` and flip all bits in the **inclusive** range `[i, n - 1]`. Flip... | We need to get the max and min value after changing num and the answer is max - min. Use brute force, try all possible changes and keep the minimum and maximum values. | Math,Greedy | Medium | null |
62 | Hello guys welcome to another video just coding whole bihar problem from here medical unique 500 robot is look at the top left corner white cross and great with a smile start the diagram and tourism place point to point is the bottom right and left his point Tours and Travels and Download and Ride Point to Understand H... | Unique Paths | unique-paths | There is a robot on an `m x n` grid. The robot is initially located at the **top-left corner** (i.e., `grid[0][0]`). The robot tries to move to the **bottom-right corner** (i.e., `grid[m - 1][n - 1]`). The robot can only move either down or right at any point in time.
Given the two integers `m` and `n`, return _the nu... | null | Math,Dynamic Programming,Combinatorics | Medium | 63,64,174,2192 |
1,642 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem for this building we can reach we're given three parameters one is a height array it's going to represent the height of each building in order so you can see we have an array like this so let's say the height of this is... | Furthest Building You Can Reach | water-bottles | You are given an integer array `heights` representing the heights of buildings, some `bricks`, and some `ladders`.
You start your journey from building `0` and move to the next building by possibly using bricks or ladders.
While moving from building `i` to building `i+1` (**0-indexed**),
* If the current building'... | Simulate the process until there are not enough empty bottles for even one full bottle of water. | Math,Simulation | Easy | null |
437 | hi everyone so let's talk about the pack some three so you're giving the root of a binary tree at the end of your topic so uh you have to return a number of paths where the sum of the values along the path able to accomplish so in this case pretty straightforward but the problem is how do you actually call this one so ... | Path Sum III | path-sum-iii | Given the `root` of a binary tree and an integer `targetSum`, return _the number of paths where the sum of the values along the path equals_ `targetSum`.
The path does not need to start or end at the root or a leaf, but it must go downwards (i.e., traveling only from parent nodes to child nodes).
**Example 1:**
**In... | null | Tree,Depth-First Search,Binary Tree | Medium | 112,113,666,687 |
879 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem profitable schemes we're given several parameters here one is a group of members so each value in this array is going to represent how many members are in each group so this one has two this one also has two we're given... | Profitable Schemes | maximize-distance-to-closest-person | There is a group of `n` members, and a list of various crimes they could commit. The `ith` crime generates a `profit[i]` and requires `group[i]` members to participate in it. If a member participates in one crime, that member can't participate in another crime.
Let's call a **profitable scheme** any subset of these cr... | null | Array | Medium | 885 |
145 | foreign then the root will be printed only after that so if you look into this example now I'll write the code so travels function so we need to have a list let's name it as result to travel through the binary tree we will have a list where each time we travel we add the elements so this will contain node and the list ... | Binary Tree Postorder Traversal | binary-tree-postorder-traversal | Given the `root` of a binary tree, return _the postorder traversal of its nodes' values_.
**Example 1:**
**Input:** root = \[1,null,2,3\]
**Output:** \[3,2,1\]
**Example 2:**
**Input:** root = \[\]
**Output:** \[\]
**Example 3:**
**Input:** root = \[1\]
**Output:** \[1\]
**Constraints:**
* The number of the n... | null | Stack,Tree,Depth-First Search,Binary Tree | Easy | 94,776 |
191 | hello everyone my name is alvaro and in this video i will be covering another problem from the blindly code 75 problem list today we will be doing problem 191 which is called number of one bits and this is one of the easiest binary problems in the list if not the easiest so this should be a short video so let's read th... | Number of 1 Bits | number-of-1-bits | Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the [Hamming weight](http://en.wikipedia.org/wiki/Hamming_weight)).
**Note:**
* Note that in some languages, such as Java, there is no unsigned integer type. In this case, the input ... | null | Bit Manipulation | Easy | 190,231,338,401,461,693,767 |
1,754 | hello everyone welcome to chorus camp so here we are at the third video of our recursion series where in our first video we saw basics of recursion how does recursion work and what are the terms used in recursion and in second video we have seen one problem search a 2d matrix that can be solved using recursion techniqu... | Largest Merge Of Two Strings | largest-merge-of-two-strings | You are given two strings `word1` and `word2`. You want to construct a string `merge` in the following way: while either `word1` or `word2` are non-empty, choose **one** of the following options:
* If `word1` is non-empty, append the **first** character in `word1` to `merge` and delete it from `word1`.
* For e... | null | null | Medium | null |
1,750 | hi everyone I'm MK welcome to my channel we have another problem of lead code daily challenge uh we have also a great code from master ugue um which he says to Shifu that you must believe and if you don't know these two great characters go on and search about them they are Masters okay so today's problem is marked medi... | Minimum Length of String After Deleting Similar Ends | check-if-two-expression-trees-are-equivalent | Given a string `s` consisting only of characters `'a'`, `'b'`, and `'c'`. You are asked to apply the following algorithm on the string any number of times:
1. Pick a **non-empty** prefix from the string `s` where all the characters in the prefix are equal.
2. Pick a **non-empty** suffix from the string `s` where all... | Count for each variable how many times it appeared in the first tree. Do the same for the second tree and check if the count is the same for both tree. | Tree,Depth-First Search,Binary Tree | Medium | 1736 |
91 | today we will solve another lead code problem that is asked in uh some of the top companies like facebook and google and it's problem number 91 and it's called decode ways and this problem says that we have a message and it contains letters from a to z and these are all capital letters and these are represented as numb... | Decode Ways | decode-ways | A message containing letters from `A-Z` can be **encoded** into numbers using the following mapping:
'A' -> "1 "
'B' -> "2 "
...
'Z' -> "26 "
To **decode** an encoded message, all the digits must be grouped then mapped back into letters using the reverse of the mapping above (there may be multiple ways). For examp... | null | String,Dynamic Programming | Medium | 639,2091 |
3 | Hello Everyone Today-Nielsen List Hello Everyone Today-Nielsen List Hello Everyone Today-Nielsen List Jalandhari Special Longest Substring Friends Traffic Inspector Sudhir Va The Longest Substring Without Repeating Characters Latest Examples for Travel Tourism Ministry BCB 300 Days Answer is A B C D Manuscript Minister... | Longest Substring Without Repeating Characters | longest-substring-without-repeating-characters | Given a string `s`, find the length of the **longest** **substring** without repeating characters.
**Example 1:**
**Input:** s = "abcabcbb "
**Output:** 3
**Explanation:** The answer is "abc ", with the length of 3.
**Example 2:**
**Input:** s = "bbbbb "
**Output:** 1
**Explanation:** The answer is "b ", with t... | null | Hash Table,String,Sliding Window | Medium | 159,340,1034,1813,2209 |
14 | in this video we'll go over lead code question number 14 longest common prefix given an array of strings we have to return the longest prefix that all the strings have in common for example if the words are flower flow and flight the longest common prefix is FL now the strategy we'll take here is a vertical scanning ap... | Longest Common Prefix | longest-common-prefix | Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string `" "`.
**Example 1:**
**Input:** strs = \[ "flower ", "flow ", "flight "\]
**Output:** "fl "
**Example 2:**
**Input:** strs = \[ "dog ", "racecar ", "car "\]
**Output:** " "... | null | String | Easy | null |
236 | question 236 of leak code lowest common ancestor of a binary tree so given a binary tree find the lowest common ancestor of two given nodes in the tree so according to the definition of the lowest common ancestor on wikipedia the lowest common ancestor is defined between two nodes p and q as the lowest node in t that h... | Lowest Common Ancestor of a Binary Tree | lowest-common-ancestor-of-a-binary-tree | Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
According to the [definition of LCA on Wikipedia](https://en.wikipedia.org/wiki/Lowest_common_ancestor): "The lowest common ancestor is defined between two nodes `p` and `q` as the lowest node in `T` that has both `p` and `q` as... | null | Tree,Depth-First Search,Binary Tree | Medium | 235,1190,1354,1780,1790,1816,2217 |
1,234 | lee code one two three four replaces substring for balance string you are given a string s of length n containing only four kinds of characters q w e and r a string is said to be balanced if each of its characters appears and force times well n is the length of the string this means like each characters should appear e... | Replace the Substring for Balanced String | number-of-paths-with-max-score | You are given a string s of length `n` containing only four kinds of characters: `'Q'`, `'W'`, `'E'`, and `'R'`.
A string is said to be **balanced** if each of its characters appears `n / 4` times where `n` is the length of the string.
Return _the minimum length of the substring that can be replaced with **any** othe... | Use dynamic programming to find the path with the max score. Use another dynamic programming array to count the number of paths with max score. | Array,Dynamic Programming,Matrix | Hard | null |
168 | it is so we know here the reference is 26 as a base so usually if you do a integer like um give us an Integrity you multiply by 10 and we divide by 10 but here you multiply between 1 by 26 because we are representing the letters from A to Z to A to Z total of 26 letters as well so next what you do after this we know if... | Excel Sheet Column Title | excel-sheet-column-title | Given an integer `columnNumber`, return _its corresponding column title as it appears in an Excel sheet_.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...
**Example 1:**
**Input:** columnNumber = 1
**Output:** "A "
**Example 2:**
**Input:** columnNumber = 28
**Output:** "AB "
**Example 3:**... | null | Math,String | Easy | 171,2304 |
45 | Hi gas welcome and welcome back tu my channel so today's our problem is jump game se de rakha hai jska land tha aapka n hai ok hai namsai aapka representing maximum length of a forward jump from index side so basically in this problem statement What is given is that you are at one position, okay, your starting position... | Jump Game II | jump-game-ii | You are given a **0-indexed** array of integers `nums` of length `n`. You are initially positioned at `nums[0]`.
Each element `nums[i]` represents the maximum length of a forward jump from index `i`. In other words, if you are at `nums[i]`, you can jump to any `nums[i + j]` where:
* `0 <= j <= nums[i]` and
* `i +... | null | Array,Dynamic Programming,Greedy | Medium | 55,1428,2001 |
1,894 | hi guys so today's question is uh find the student that will replace the chalk so this is the medium complexity question has been solved so there are n students uh class number from 0 to n minus one okay the teacher will give each student a problem starting with the student zero okay starting with student zero the teac... | Find the Student that Will Replace the Chalk | merge-strings-alternately | There are `n` students in a class numbered from `0` to `n - 1`. The teacher will give each student a problem starting with the student number `0`, then the student number `1`, and so on until the teacher reaches the student number `n - 1`. After that, the teacher will restart the process, starting with the student numb... | Use two pointers, one pointer for each string. Alternately choose the character from each pointer, and move the pointer upwards. | Two Pointers,String | Easy | 281 |
739 | hey guys welcome to a new video in today's video we're going to look at a lead code problem and the problem's name is daily temperatures so in this question we're given an integer array called temperatures which represents daily temperatures and we have to return an integer array called answer so here you can see that ... | Daily Temperatures | daily-temperatures | Given an array of integers `temperatures` represents the daily temperatures, return _an array_ `answer` _such that_ `answer[i]` _is the number of days you have to wait after the_ `ith` _day to get a warmer temperature_. If there is no future day for which this is possible, keep `answer[i] == 0` instead.
**Example 1:**... | If the temperature is say, 70 today, then in the future a warmer temperature must be either 71, 72, 73, ..., 99, or 100. We could remember when all of them occur next. | Array,Stack,Monotonic Stack | Medium | 496,937 |
1,478 | hey everybody this is Larry I'm doing this problem as part of a contest so you're gonna watch me live as I go through my darts I'm coding they've been explanation near the end and for more context they'll be a link below on this actual screencast of the contest how did you do let me know you do hit the like button eith... | Allocate Mailboxes | maximum-number-of-events-that-can-be-attended | Given the array `houses` where `houses[i]` is the location of the `ith` house along a street and an integer `k`, allocate `k` mailboxes in the street.
Return _the **minimum** total distance between each house and its nearest mailbox_.
The test cases are generated so that the answer fits in a 32-bit integer.
**Exampl... | Sort the events by the start time and in case of tie by the end time in ascending order. Loop over the sorted events. Attend as much as you can and keep the last day occupied. When you try to attend new event keep in mind the first day you can attend a new event in. | Array,Greedy,Heap (Priority Queue) | Medium | 1851,2118 |
1,637 | hello everyone welcome to another video now in this video we are going to look at another arrays medium level question but it says medium but it is really easy so let's understand what it says and then we'll continue with the solution so the first thing is that we are given the question in a graphical manner we are giv... | Widest Vertical Area Between Two Points Containing No Points | string-compression-ii | Given `n` `points` on a 2D plane where `points[i] = [xi, yi]`, Return _the **widest vertical area** between two points such that no points are inside the area._
A **vertical area** is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The **widest vertical area** is the one with the ... | Use dynamic programming. The state of the DP can be the current index and the remaining characters to delete. Having a prefix sum for each character can help you determine for a certain character c in some specific range, how many characters you need to delete to merge all occurrences of c in that range. | String,Dynamic Programming | Hard | null |
966 | hey what's up guys this is joong so today it's called 966 vow spell checker you're given like a word list and we want to implement a spell checker that converts the query word into a correct word and the rules are like kind of long here so to summarize it's real quick you know given like a query word uh we need to make... | Vowel Spellchecker | binary-subarrays-with-sum | Given a `wordlist`, we want to implement a spellchecker that converts a query word into a correct word.
For a given `query` word, the spell checker handles two categories of spelling mistakes:
* Capitalization: If the query matches a word in the wordlist (**case-insensitive**), then the query word is returned with ... | null | Array,Hash Table,Sliding Window,Prefix Sum | Medium | null |
138 | foreign hi everyone I'm Dr surjit Singh last week I had uploaded a video on lead code problem for deep copy of a given linked list today I am talking about a refined version of the same problem to my video let us begin in this problem we are given a linked list which has an extra pointer called random pointer we are to... | Copy List with Random Pointer | copy-list-with-random-pointer | A linked list of length `n` is given such that each node contains an additional random pointer, which could point to any node in the list, or `null`.
Construct a [**deep copy**](https://en.wikipedia.org/wiki/Object_copying#Deep_copy) of the list. The deep copy should consist of exactly `n` **brand new** nodes, where e... | Just iterate the linked list and create copies of the nodes on the go. Since a node can be referenced from multiple nodes due to the random pointers, make sure you are not making multiple copies of the same node. You may want to use extra space to keep old node ---> new node mapping to prevent creating multiples copies... | Hash Table,Linked List | Medium | 133,1624,1634 |
137 | hey everybody this is Larry this is day four oh happy Fourth of July for those of you who celebrate the 4th of July or in America uh the Independence Day uh it's technically still actually the dirt here uh when I'm doing it but you know all this other good stuff hope everyone's having a good um you know everything is 1... | Single Number II | single-number-ii | Given an integer array `nums` where every element appears **three times** except for one, which appears **exactly once**. _Find the single element and return it_.
You must implement a solution with a linear runtime complexity and use only constant extra space.
**Example 1:**
**Input:** nums = \[2,2,3,2\]
**Output:**... | null | Array,Bit Manipulation | Medium | 136,260 |
901 | This is a medium level problem and the one who has a very simple problem in trust, there is nothing to worry about, so first of all let us see what is given to us in which question and what these questions say to themselves in this question. You have told yourself that you have to design an algorithm which will analyze... | Online Stock Span | advantage-shuffle | Design an algorithm that collects daily price quotes for some stock and returns **the span** of that stock's price for the current day.
The **span** of the stock's price in one day is the maximum number of consecutive days (starting from that day and going backward) for which the stock price was less than or equal to ... | null | Array,Greedy,Sorting | Medium | null |
57 | hello and welcome to this video tutorial on how to implement a solution for inserting a new interval into a vector of intervals first let's understand the problem statement the problem we are trying to solve is to take a vector of intervals represented as a vector of integers and a single new interval also represented ... | Insert Interval | insert-interval | You are given an array of non-overlapping intervals `intervals` where `intervals[i] = [starti, endi]` represent the start and the end of the `ith` interval and `intervals` is sorted in ascending order by `starti`. You are also given an interval `newInterval = [start, end]` that represents the start and end of another i... | null | Array | Medium | 56,715 |
297 | okay now i have a coding interview question serialized and decelerate binary tree this question was recently asked by google design an algorithm to satellite and decelerate a binary tree there is no restriction on how your serialization or deserialization algorithm should work you just need to ensure that a binary tree... | Serialize and Deserialize Binary Tree | serialize-and-deserialize-binary-tree | Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
Design an algorithm to serialize and deserialize a bi... | null | String,Tree,Depth-First Search,Breadth-First Search,Design,Binary Tree | Hard | 271,449,652,765 |
843 | cool 843 gets the word of this problem is an interactive new to delete code platform okay well I guess we'll see people don't like it so much that's how I guess mostly I it's new to me - sigh I guess mostly I it's new to me - sigh I guess mostly I it's new to me - sigh whoopsie we coming up word list of unique words ea... | Guess the Word | binary-trees-with-factors | You are given an array of unique strings `words` where `words[i]` is six letters long. One word of `words` was chosen as a secret word.
You are also given the helper object `Master`. You may call `Master.guess(word)` where `word` is a six-letter-long string, and it must be from `words`. `Master.guess(word)` returns:
... | null | Array,Hash Table,Dynamic Programming | Medium | null |
139 | Hello friends today I am going to solve liquid problem number 139 word break so we are given a string as and a dictionary of strings word ticked and we are going to return true if s can be segmented into space separated sequence of one or more dictionary words so what does this mean let's look at this example over here... | Word Break | word-break | Given a string `s` and a dictionary of strings `wordDict`, return `true` if `s` can be segmented into a space-separated sequence of one or more dictionary words.
**Note** that the same word in the dictionary may be reused multiple times in the segmentation.
**Example 1:**
**Input:** s = "leetcode ", wordDict = \[ "... | null | Hash Table,String,Dynamic Programming,Trie,Memoization | Medium | 140 |
326 | so this question is power of three uh lead code number 326 give it an integer and return true if it is a power of three otherwise return false so uh for example you have 27 you want to check if it's a power of 3 or not so the first thing is that you want to divide it by 3 and check out the remainder if it's not equal t... | Power of Three | power-of-three | Given an integer `n`, return _`true` if it is a power of three. Otherwise, return `false`_.
An integer `n` is a power of three, if there exists an integer `x` such that `n == 3x`.
**Example 1:**
**Input:** n = 27
**Output:** true
**Explanation:** 27 = 33
**Example 2:**
**Input:** n = 0
**Output:** false
**Explanat... | null | Math,Recursion | Easy | 231,342,1889 |
203 | Hello Everybody Welcome To My Channel Today Date 20th July Lifting Challenge Any Problem In Removing List Elements Or Remove All Elements From Early And Just Half Velvet So Example Vighn 123 456 To Remove All Subscribe 12345 Will Solve This Problem With Now Scam In Your Mind To Create Rich Person If Subscribe Point To ... | Remove Linked List Elements | remove-linked-list-elements | Given the `head` of a linked list and an integer `val`, remove all the nodes of the linked list that has `Node.val == val`, and return _the new head_.
**Example 1:**
**Input:** head = \[1,2,6,3,4,5,6\], val = 6
**Output:** \[1,2,3,4,5\]
**Example 2:**
**Input:** head = \[\], val = 1
**Output:** \[\]
**Example 3:**... | null | Linked List,Recursion | Easy | 27,237,2216 |
494 | everyone welcome back and let's write some more neat code today so today let's solve the problem target sum we're given an array of integers called nums and we're also given a single integer called target and basically for every single number in the array nums we can either choose to add that number or subtract that nu... | Target Sum | target-sum | You are given an integer array `nums` and an integer `target`.
You want to build an **expression** out of nums by adding one of the symbols `'+'` and `'-'` before each integer in nums and then concatenate all the integers.
* For example, if `nums = [2, 1]`, you can add a `'+'` before `2` and a `'-'` before `1` and ... | null | Array,Dynamic Programming,Backtracking | Medium | 282 |
69 | hey there everyone welcome back again to lead coding i am your host faraz and on this channel i upload content related to your coding interviews so this is the series which i am making for interview preparation and this is the assignment question of the binary search so i think if you haven't tried this problem you sho... | Sqrt(x) | sqrtx | Given a non-negative integer `x`, return _the square root of_ `x` _rounded down to the nearest integer_. The returned integer should be **non-negative** as well.
You **must not use** any built-in exponent function or operator.
* For example, do not use `pow(x, 0.5)` in c++ or `x ** 0.5` in python.
**Example 1:**
... | Try exploring all integers. (Credits: @annujoshi) Use the sorted property of integers to reduced the search space. (Credits: @annujoshi) | Math,Binary Search | Easy | 50,367 |
199 | Hello hello friends in this session go to discuss another list to problem binary tree right side you give with lemon interview question ashwin month company give vote to find written notes in right side example you can see only did not give one to three and return value of Examples Right Side 9090 3840 Width Him Will N... | Binary Tree Right Side View | binary-tree-right-side-view | Given the `root` of a binary tree, imagine yourself standing on the **right side** of it, return _the values of the nodes you can see ordered from top to bottom_.
**Example 1:**
**Input:** root = \[1,2,3,null,5,null,4\]
**Output:** \[1,3,4\]
**Example 2:**
**Input:** root = \[1,null,3\]
**Output:** \[1,3\]
**Examp... | null | Tree,Depth-First Search,Breadth-First Search,Binary Tree | Medium | 116,545 |
1,751 | hello guys welcome to deep codes and in today's video we will discuss liquid question 1751 that says maximum number of events that can be attended too so guys although this question is tagged as a hard question but this is somewhere between medium to medium hard question and it's not that difficult you can easily not t... | Maximum Number of Events That Can Be Attended II | slowest-key | You are given an array of `events` where `events[i] = [startDayi, endDayi, valuei]`. The `ith` event starts at `startDayi` and ends at `endDayi`, and if you attend this event, you will receive a value of `valuei`. You are also given an integer `k` which represents the maximum number of events you can attend.
You can o... | Get for each press its key and amount of time taken. Iterate on the presses, maintaining the answer so far. The current press will change the answer if and only if its amount of time taken is longer than that of the previous answer, or they are equal but the key is larger than that of the previous answer. | Array,String | Easy | null |
134 | welcome to september's lee code challenge today's problem is gas station there are n gas stations along a circular road where the amount of gas at station i is gas high you have a car with a limited gas tank and it costs cost i of gas to travel from station i to its next station i plus one you begin the journey with an... | Gas Station | gas-station | There are `n` gas stations along a circular route, where the amount of gas at the `ith` station is `gas[i]`.
You have a car with an unlimited gas tank and it costs `cost[i]` of gas to travel from the `ith` station to its next `(i + 1)th` station. You begin the journey with an empty tank at one of the gas stations.
Gi... | null | Array,Greedy | Medium | 1346 |
222 | I find this problem very funny because when you first look at it seems so simple you are given a binary tree and you just have to find out what is the total count of all the nodes correct it starts to get tricky when you have to do it in the fastest way possible so let's see what we can do about it Hello friends welcom... | Count Complete Tree Nodes | count-complete-tree-nodes | Given the `root` of a **complete** binary tree, return the number of the nodes in the tree.
According to **[Wikipedia](http://en.wikipedia.org/wiki/Binary_tree#Types_of_binary_trees)**, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far lef... | null | Binary Search,Tree,Depth-First Search,Binary Tree | Medium | 270 |
283 | hey welcome to this video we're gonna be doing lis coke problem 283 move zeros so they're gonna pass us an input array of numbers and then we want to modify the input array in place and put nonzero numbers towards the start and put numbers that are zero towards the end as we can see here but you also want to maintain t... | Move Zeroes | move-zeroes | Given an integer array `nums`, move all `0`'s to the end of it while maintaining the relative order of the non-zero elements.
**Note** that you must do this in-place without making a copy of the array.
**Example 1:**
**Input:** nums = \[0,1,0,3,12\]
**Output:** \[1,3,12,0,0\]
**Example 2:**
**Input:** nums = \[0\]... | In-place means we should not be allocating any space for extra array. But we are allowed to modify the existing array. However, as a first step, try coming up with a solution that makes use of additional space. For this problem as well, first apply the idea discussed using an additional array and the in-place solution ... | Array,Two Pointers | Easy | 27 |
509 | hello guys i'm pawan in this playlist we are going to discuss about each and every solution of daily lit code challenges this playlist contains solution of daily 4 challenge from 6th july of 2022 yeah we are going to discuss our first problem which is fibonacci series okay guys our algorithm for our fibonacci series wi... | Fibonacci Number | inorder-successor-in-bst-ii | The **Fibonacci numbers**, commonly denoted `F(n)` form a sequence, called the **Fibonacci sequence**, such that each number is the sum of the two preceding ones, starting from `0` and `1`. That is,
F(0) = 0, F(1) = 1
F(n) = F(n - 1) + F(n - 2), for n > 1.
Given `n`, calculate `F(n)`.
**Example 1:**
**Input:** n = ... | null | Tree,Binary Search Tree,Binary Tree | Medium | 285 |
445 | hey everyone today we are going to solitary for the question number two so you are given two non-empty linked lists you are given two non-empty linked lists you are given two non-empty linked lists representing two non-negative integers representing two non-negative integers representing two non-negative integers the m... | Add Two Numbers II | add-two-numbers-ii | You are given two **non-empty** linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itsel... | null | Linked List,Math,Stack | Medium | 2,1774 |
1,320 | hello so today our continuing on this contest nuclear contest 171 the last problem which is problem 1320 minimum distance to type or world using two fingers so the problem says we have a we have this cue ball right here with the uppercase letters that are organized it in this way and then that's so we have a keyboard l... | Minimum Distance to Type a Word Using Two Fingers | remove-all-adjacent-duplicates-in-string-ii | You have a keyboard layout as shown above in the **X-Y** plane, where each English uppercase letter is located at some coordinate.
* For example, the letter `'A'` is located at coordinate `(0, 0)`, the letter `'B'` is located at coordinate `(0, 1)`, the letter `'P'` is located at coordinate `(2, 3)` and the letter `... | Use a stack to store the characters, when there are k same characters, delete them. To make it more efficient, use a pair to store the value and the count of each character. | String,Stack | Medium | 1128,2307 |
10 | They guys welcome back to my YouTube channel I am UTS and in this video series we are solving the problems of lift. If you have not seen this video series of mine then you can access my entire video series by clicking on the button above. And today we are going to look at the regular expression matching problem, so let... | Regular Expression Matching | regular-expression-matching | Given an input string `s` and a pattern `p`, implement regular expression matching with support for `'.'` and `'*'` where:
* `'.'` Matches any single character.
* `'*'` Matches zero or more of the preceding element.
The matching should cover the **entire** input string (not partial).
**Example 1:**
**Input:... | null | String,Dynamic Programming,Recursion | Hard | 44 |
352 | hi everyone so this question data stream is destroying the world so um i'm going to just summarize this question so uh you are giving a class summary of summary ranges and basically you can add the interval into the class and also you have to get an intervals in a class so again so if you are empty so initially you hav... | Data Stream as Disjoint Intervals | data-stream-as-disjoint-intervals | Given a data stream input of non-negative integers `a1, a2, ..., an`, summarize the numbers seen so far as a list of disjoint intervals.
Implement the `SummaryRanges` class:
* `SummaryRanges()` Initializes the object with an empty stream.
* `void addNum(int value)` Adds the integer `value` to the stream.
* `int... | null | Binary Search,Design,Ordered Set | Hard | 228,436,715 |
1,551 | hi everyone my name is steve today we're going to go through legal problem 1551 minimum operations to make array equal this is labeled as medium but it's pretty straightforward but i'd like to go through my thought process of course there are multiple different ways my way might not be the most optimal in fact actually... | Minimum Operations to Make Array Equal | npv-queries | You have an array `arr` of length `n` where `arr[i] = (2 * i) + 1` for all valid values of `i` (i.e., `0 <= i < n`).
In one operation, you can select two indices `x` and `y` where `0 <= x, y < n` and subtract `1` from `arr[x]` and add `1` to `arr[y]` (i.e., perform `arr[x] -=1` and `arr[y] += 1`). The goal is to make ... | null | Database | Easy | null |
319 | hey you know that's all these are oh score problem uh i think this problem is showing the ted yeah so the apprentices are probably not related to coding but bob's bleacher okay so there are on bob's initials off right you turn on all bops and now third round you so basically in the first round you're touching bob's you... | Bulb Switcher | bulb-switcher | There are `n` bulbs that are initially off. You first turn on all the bulbs, then you turn off every second bulb.
On the third round, you toggle every third bulb (turning on if it's off or turning off if it's on). For the `ith` round, you toggle every `i` bulb. For the `nth` round, you only toggle the last bulb.
Retu... | null | Math,Brainteaser | Medium | 672,1037,1491 |
263 | Hello Welcome Gas So today's question in our Daily Need Coding Challenge is what is the next number? According to its definition, it will be any positive number whose prime factors will be limited to 2, 3 and 5, meaning other than 2, 3, 5 and If any prime factor is offered in it then it is not the next number. Okay, so... | Ugly Number | ugly-number | An **ugly number** is a positive integer whose prime factors are limited to `2`, `3`, and `5`.
Given an integer `n`, return `true` _if_ `n` _is an **ugly number**_.
**Example 1:**
**Input:** n = 6
**Output:** true
**Explanation:** 6 = 2 \* 3
**Example 2:**
**Input:** n = 1
**Output:** true
**Explanation:** 1 has n... | null | Math | Easy | 202,204,264 |
410 | hello and welcome back to the cracking fang youtube channel today we're going to be solving lead code problem 410 split array largest sum before we get into this problem i just want to say that this question is very similar to three that have already solved on my channel those being cutting ribbons capacity to ship pac... | Split Array Largest Sum | split-array-largest-sum | Given an integer array `nums` and an integer `k`, split `nums` into `k` non-empty subarrays such that the largest sum of any subarray is **minimized**.
Return _the minimized largest sum of the split_.
A **subarray** is a contiguous part of the array.
**Example 1:**
**Input:** nums = \[7,2,5,10,8\], k = 2
**Output:*... | null | Array,Binary Search,Dynamic Programming,Greedy | Hard | 1056,1192,2242,2330 |
1,876 | okay let's do Elite code one eight seven six substrings of size three uh with distinct characters um this is another sliding window problem basically you need to look through this input string and find um substrings that are of size three it's pretty self-explanatory it's pretty self-explanatory it's pretty self-explan... | Substrings of Size Three with Distinct Characters | map-of-highest-peak | A string is **good** if there are no repeated characters.
Given a string `s`, return _the number of **good substrings** of length **three** in_ `s`.
Note that if there are multiple occurrences of the same substring, every occurrence should be counted.
A **substring** is a contiguous sequence of characters... | Set each water cell to be 0. The height of each cell is limited by its closest water cell. Perform a multi-source BFS with all the water cells as sources. | Array,Breadth-First Search,Matrix | Medium | null |
554 | hello and welcome back to another Elite code problem today we're going to be doing problem number 554 brick wall and so in this problem you're given in a rectangular brick wall with n rows of bricks the I throw has some number of bricks each of the same height but they can be a different width and the total width of ea... | Brick Wall | brick-wall | There is a rectangular brick wall in front of you with `n` rows of bricks. The `ith` row has some number of bricks each of the same height (i.e., one unit) but they can be of different widths. The total width of each row is the same.
Draw a vertical line from the top to the bottom and cross the least bricks. If your l... | null | Array,Hash Table | Medium | 2322 |
1,325 | hi friends welcome to joy of life so today's second problem um another medium one from lead code the problem number is 1325. it's a medium level problem and the problem description says delete leaves with a given value so we are supposed to delete the leaves with a given value so let's look at the description given a b... | Delete Leaves With a Given Value | path-with-maximum-probability | Given a binary tree `root` and an integer `target`, delete all the **leaf nodes** with value `target`.
Note that once you delete a leaf node with value `target`**,** if its parent node becomes a leaf node and has the value `target`, it should also be deleted (you need to continue doing that until you cannot).
**Examp... | Multiplying probabilities will result in precision errors. Take log probabilities to sum up numbers instead of multiplying them. Use Dijkstra's algorithm to find the minimum path between the two nodes after negating all costs. | Graph,Heap (Priority Queue),Shortest Path | Medium | 2090 |
486 | hey everybody this is Larry this is me doing a bonus question basically trying to do a poem that I have not done yet um because you know the daily problems I actually you know solved enough problems I don't know if you can see the top I bring my face oh no it's fine um I've solved all these problems so there are a lot ... | Predict the Winner | predict-the-winner | You are given an integer array `nums`. Two players are playing a game with this array: player 1 and player 2.
Player 1 and player 2 take turns, with player 1 starting first. Both players start the game with a score of `0`. At each turn, the player takes one of the numbers from either end of the array (i.e., `nums[0]` ... | null | Array,Math,Dynamic Programming,Recursion,Game Theory | Medium | 464 |
1,041 | hello everyone welcome today we are looking at the lead code question which is a robot bounded in circle so in this question we are given an infinite plane wherein a robot is standing at zero comma zero and faces north the robot receives one of the three direction instructions which is go turn left or turn right now af... | Robot Bounded In Circle | available-captures-for-rook | On an infinite plane, a robot initially stands at `(0, 0)` and faces north. Note that:
* The **north direction** is the positive direction of the y-axis.
* The **south direction** is the negative direction of the y-axis.
* The **east direction** is the positive direction of the x-axis.
* The **west direction**... | null | Array,Matrix,Simulation | Easy | null |
108 | Hai gas welcome you today's video and today we are going to do 108 problem of lead code whose name is convert, we have to convert it into binary and the binary search history we are going to create or construct should be a hi- or construct should be a hi- or construct should be a hi- tech binary free height. By lens an... | Convert Sorted Array to Binary Search Tree | convert-sorted-array-to-binary-search-tree | Given an integer array `nums` where the elements are sorted in **ascending order**, convert _it to a_ **_height-balanced_** _binary search tree_.
**Example 1:**
**Input:** nums = \[-10,-3,0,5,9\]
**Output:** \[0,-3,9,-10,null,5\]
**Explanation:** \[0,-10,5,null,-3,null,9\] is also accepted:
**Example 2:**
**Input... | null | Array,Divide and Conquer,Tree,Binary Search Tree,Binary Tree | Easy | 109 |
2 | how's it going everybody are you ready to think forward all right let's do another question so today we're gonna actually focus on a question number two and Lee code just called add two numbers now this question is even though it's ranked medium I kind of feel that this one is actually more on the easier side of things... | Add Two Numbers | add-two-numbers | You are given two **non-empty** linked lists representing two non-negative integers. The digits are stored in **reverse order**, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 ... | null | Linked List,Math,Recursion | Medium | 43,67,371,415,445,1031,1774 |
535 | That Welcome back train today we are going to solve liquid problem 1186 in court and quote time URL for this is very important problem Pyaar preparing for including interview Someshwar you understand this problem of this problem in Amazon Facebook Google assistant service is there so let's go and article On Thyroid Pro... | Encode and Decode TinyURL | encode-and-decode-tinyurl | > Note: This is a companion problem to the [System Design](https://leetcode.com/discuss/interview-question/system-design/) problem: [Design TinyURL](https://leetcode.com/discuss/interview-question/124658/Design-a-URL-Shortener-(-TinyURL-)-System/).
TinyURL is a URL shortening service where you enter a URL such as `htt... | null | Hash Table,String,Design,Hash Function | Medium | null |
1,282 | and also continuing on this weekly contest 166 I'm going to do the second problem so the problem says the problem is 1282 group the people even the group size they belong to it's a little bit confusing title and description but let's try to understand it so we have n people and they are they have IDs that go from 0 to ... | Group the People Given the Group Size They Belong To | number-of-valid-words-for-each-puzzle | There are `n` people that are split into some unknown number of groups. Each person is labeled with a **unique ID** from `0` to `n - 1`.
You are given an integer array `groupSizes`, where `groupSizes[i]` is the size of the group that person `i` is in. For example, if `groupSizes[1] = 3`, then person `1` must be in a g... | Exploit the fact that the length of the puzzle is only 7. Use bit-masks to represent the word and puzzle strings. For each puzzle, count the number of words whose bit-mask is a sub-mask of the puzzle's bit-mask. | Array,Hash Table,String,Bit Manipulation,Trie | Hard | null |
337 | hey guys welcome back to another video and today we're going to be solving the lead code question house robber 2 all right so this is part of the house robber set of questions so i did solve a few of them earlier so do check that out if you're interested okay so in this case uh the thief is yet again trying to steal mo... | House Robber III | house-robber-iii | The thief has found himself a new place for his thievery again. There is only one entrance to this area, called `root`.
Besides the `root`, each house has one and only one parent house. After a tour, the smart thief realized that all houses in this place form a binary tree. It will automatically contact the police if ... | null | Dynamic Programming,Tree,Depth-First Search,Binary Tree | Medium | 198,213 |
213 | hello guys welcome to algorithms made easy my name is rajat and today we will be discussing the question house robber part two this question is a extension to the previous problem that we have already solved house robber so if you haven't done that question or haven't watched the video do what it the link is at the top... | House Robber II | house-robber-ii | You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are **arranged in a circle.** That means the first house is the neighbor of the last one. Meanwhile, adjacent houses have a security system connected, and **it will automatical... | Since House[1] and House[n] are adjacent, they cannot be robbed together. Therefore, the problem becomes to rob either House[1]-House[n-1] or House[2]-House[n], depending on which choice offers more money. Now the problem has degenerated to the House Robber, which is already been solved. | Array,Dynamic Programming | Medium | 198,256,276,337,600,656 |
92 | so today I'm going to solve the problem which is to call reverse it stop this of a living this question is in the book that I use is called elements of programming interviews and it's also by only code so the question is - why so only code so the question is - why so only code so the question is - why so let me stop at... | Reverse Linked List II | reverse-linked-list-ii | Given the `head` of a singly linked list and two integers `left` and `right` where `left <= right`, reverse the nodes of the list from position `left` to position `right`, and return _the reversed list_.
**Example 1:**
**Input:** head = \[1,2,3,4,5\], left = 2, right = 4
**Output:** \[1,4,3,2,5\]
**Example 2:**
**I... | null | Linked List | Medium | 206 |
310 | Hello Everyone Welcome to Date 16th December 14 Inch Unforgettable Love Life Congratulations Tube School Completed 20 December 28 2010 Also Withdraw All the Questions The Video then subscribe to The Amazing subscribe Video Subscribe Should They Give the Dad Taxes Between 101 2013 Acid and Possibilities in the Middle Ve... | Minimum Height Trees | minimum-height-trees | A tree is an undirected graph in which any two vertices are connected by _exactly_ one path. In other words, any connected graph without simple cycles is a tree.
Given a tree of `n` nodes labelled from `0` to `n - 1`, and an array of `n - 1` `edges` where `edges[i] = [ai, bi]` indicates that there is an undirected edg... | How many MHTs can a graph have at most? | Depth-First Search,Breadth-First Search,Graph,Topological Sort | Medium | 207,210 |
37 | Say hello to Ajay Hi everyone, I am your Shraddha and welcome to Apna College. In today's video, we are going to study a very beautiful problem of Recognition in Backtracking whose name is Sudoku Solver. Many people have heard of Sudoku Shuddha. And this is the problem, this caste comes out a lot in the coding test als... | Sudoku Solver | sudoku-solver | Write a program to solve a Sudoku puzzle by filling the empty cells.
A sudoku solution must satisfy **all of the following rules**:
1. Each of the digits `1-9` must occur exactly once in each row.
2. Each of the digits `1-9` must occur exactly once in each column.
3. Each of the digits `1-9` must occur exactly onc... | null | Array,Backtracking,Matrix | Hard | 36,1022 |
14 | hey what's up guys think white here I do tech encoding stuff on Twitch in YouTube do the premium problems on patreon and I do if you want to reach out to me just doing my disc or message me try to get back to ever this is a problem called longest common prefix got some like some dislikes pretty split reviews right a fu... | Longest Common Prefix | longest-common-prefix | Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string `" "`.
**Example 1:**
**Input:** strs = \[ "flower ", "flow ", "flight "\]
**Output:** "fl "
**Example 2:**
**Input:** strs = \[ "dog ", "racecar ", "car "\]
**Output:** " "... | null | String | Easy | null |
420 | hey everybody this is larry hit the like button hit the subscribe button let me know how you did on this problem i'm gonna solve it live right about now okay so 420 okay 420. strong password checker a password is considered strong if the below conditions are met it has six characters and at most 20 characters it must c... | Strong Password Checker | strong-password-checker | A password is considered strong if the below conditions are all met:
* It has at least `6` characters and at most `20` characters.
* It contains at least **one lowercase** letter, at least **one uppercase** letter, and at least **one digit**.
* It does not contain three repeating characters in a row (i.e., `"B**... | null | String,Greedy,Heap (Priority Queue) | Hard | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.