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 |
|---|---|---|---|---|---|---|---|---|
31 | Hello guys welcome back two decades and you will see the next permission problem between this point number-31 100 latest the between this point number-31 100 latest the between this point number-31 100 latest the problem statement in this problem Thursday graphically greater attention of number in this channel it is no... | Next Permutation | next-permutation | A **permutation** of an array of integers is an arrangement of its members into a sequence or linear order.
* For example, for `arr = [1,2,3]`, the following are all the permutations of `arr`: `[1,2,3], [1,3,2], [2, 1, 3], [2, 3, 1], [3,1,2], [3,2,1]`.
The **next permutation** of an array of integers is the next le... | null | Array,Two Pointers | Medium | 46,47,60,267,1978 |
1,038 | hello everyone today we are going to solve the report problem which is 1 0 3 so now and we have to convert it into a great tree such that every key history is changed to the original key value plus the sum of all the keys greater than the operation of the pst so as you all know that bst is a binary search tree in which... | Binary Search Tree to Greater Sum Tree | number-of-squareful-arrays | Given the `root` of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.
As a reminder, a _binary search tree_ is a tree that satisfies these constraints:
* The left subtree of a... | null | Array,Math,Dynamic Programming,Backtracking,Bit Manipulation,Bitmask | Hard | 47 |
143 | hi everyone it's cin today we are going to solve reorder list problem the problem is that we are given a list and we need to reorder that list for example in this case we are given this list one two three and let's say that it's an element or there are some elements this is the n element and we need to represent it in ... | Reorder List | reorder-list | You are given the head of a singly linked-list. The list can be represented as:
L0 -> L1 -> ... -> Ln - 1 -> Ln
_Reorder the list to be on the following form:_
L0 -> Ln -> L1 -> Ln - 1 -> L2 -> Ln - 2 -> ...
You may not modify the values in the list's nodes. Only nodes themselves may be changed.
**Example 1:**
**... | null | Linked List,Two Pointers,Stack,Recursion | Medium | 2216 |
1,307 | I had also continuing on this late code contest 169 per the last problem 1309 verbal a thematic puzzle so the problem says given an equation represented by words on the left side and the result on the right side we need to check if the equation is solvable under a set of rules and so the rules are first every character... | Verbal Arithmetic Puzzle | ugly-number-iii | Given an equation, represented by `words` on the left side and the `result` on the right side.
You need to check if the equation is solvable under the following rules:
* Each character is decoded as one digit (0 - 9).
* No two characters can map to the same digit.
* Each `words[i]` and `result` are decoded as o... | Write a function f(k) to determine how many ugly numbers smaller than k. As f(k) is non-decreasing, try binary search. Find all ugly numbers in [1, LCM(a, b, c)] (LCM is Least Common Multiple). Use inclusion-exclusion principle to expand the result. | Math,Binary Search,Number Theory | Medium | 264 |
62 | Hello everyone welcome you are going to do video number 63 of my channel okay and you can follow this playlist for DP concession questions if you want to understand DP from scratch okay and today's lead code is lead code number 62 very AG questions actually in simple regression and the bottom can be there for all of yo... | 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 |
188 | hi guys welcome to Tech geek so today I am back with another lead code daily challenge problem that's why and sell stocks for so talk about why I'm not making videos every day having been pinged by many of you for the videos so basically I'm preparing for Google I have opportunity there so the last rounds are remaining... | Best Time to Buy and Sell Stock IV | best-time-to-buy-and-sell-stock-iv | You are given an integer array `prices` where `prices[i]` is the price of a given stock on the `ith` day, and an integer `k`.
Find the maximum profit you can achieve. You may complete at most `k` transactions: i.e. you may buy at most `k` times and sell at most `k` times.
**Note:** You may not engage in multiple tran... | null | Array,Dynamic Programming | Hard | 121,122,123 |
1,443 | Hello Friends Updated On A Criminal Directory Consisting Of Important Notes For Students With This Translates Apple Do Not Subscribe Thank You A Total One Word Problem Solved Will Start In Turn Will Cost Mid Cap And Mid Day Aug 12 How To Build First Term Movies Twist French twist ok now pick up notification Rafi how to... | Minimum Time to Collect All Apples in a Tree | minimum-distance-to-type-a-word-using-two-fingers | Given an undirected tree consisting of `n` vertices numbered from `0` to `n-1`, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. _Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at **vertex 0** and coming back to this vertex.... | Use dynamic programming. dp[i][j][k]: smallest movements when you have one finger on i-th char and the other one on j-th char already having written k first characters from word. | String,Dynamic Programming | Hard | 2088 |
1,277 | welcome to Mays LICO challenge today's problem is count squares some matrices with all one's given an M times and matrix of ones and zeros return how many squares some matrices have all ones let's say we've been given a matrix like this a point this point here you can see that there's a 1 by 1 matrix square of ones but... | Count Square Submatrices with All Ones | largest-multiple-of-three | Given a `m * n` matrix of ones and zeros, return how many **square** submatrices have all ones.
**Example 1:**
**Input:** matrix =
\[
\[0,1,1,1\],
\[1,1,1,1\],
\[0,1,1,1\]
\]
**Output:** 15
**Explanation:**
There are **10** squares of side 1.
There are **4** squares of side 2.
There is **1** square of side 3.... | A number is a multiple of three if and only if its sum of digits is a multiple of three. Use dynamic programming. To find the maximum number, try to maximize the number of digits of the number. Sort the digits in descending order to find the maximum number. | Array,Dynamic Programming,Greedy | Hard | null |
65 | foreign this is the 65 problem statement in lead code is the hard level here we are checking that whether the given stream like this what are the given string is valid number or not how do you save it is really valid uh when it is it contains only numbers this is nothing but integer or float contains character and some... | Valid Number | valid-number | A **valid number** can be split up into these components (in order):
1. A **decimal number** or an **integer**.
2. (Optional) An `'e'` or `'E'`, followed by an **integer**.
A **decimal number** can be split up into these components (in order):
1. (Optional) A sign character (either `'+'` or `'-'`).
2. One of the... | null | String | Hard | 8 |
33 | Jhamb and teachers by many in this video number six in question number six will do the name of the question is search na rotate sorted. Okay, the special thing about this question will be that before this we have made the same question with its solution in the previous videos. It will be okay just to tell the party tha... | Search in Rotated Sorted Array | search-in-rotated-sorted-array | There is an integer array `nums` sorted in ascending order (with **distinct** values).
Prior to being passed to your function, `nums` is **possibly rotated** at an unknown pivot index `k` (`1 <= k < nums.length`) such that the resulting array is `[nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]]` ... | null | Array,Binary Search | Medium | 81,153,2273 |
413 | That Hey Guys Welcome Back To My Channel In This Video We Are Going To Solve Arithmetic Slices Its Dates Key Problem Of Marksheet Challenge Know What Is The Given Statement Here And Interior Is Called Arithmetic Shift Kar Sister Of At Least Three Elements And Difference Between Any Two Consecutive Element Same for Exam... | Arithmetic Slices | arithmetic-slices | An integer array is called arithmetic if it consists of **at least three elements** and if the difference between any two consecutive elements is the same.
* For example, `[1,3,5,7,9]`, `[7,7,7,7]`, and `[3,-1,-5,-9]` are arithmetic sequences.
Given an integer array `nums`, return _the number of arithmetic **subarr... | null | Array,Dynamic Programming | Medium | 446,1752 |
1,798 | hello everyone let's take a look at the code on one seven nine eight it's a sub problem in the birthday context but acceptance rate of this context is on about 30 so it's not very high but actually this problem is not a very hard problem okay let's take a look at how to solve this problem okay and if you haven't read t... | Maximum Number of Consecutive Values You Can Make | max-number-of-k-sum-pairs | You are given an integer array `coins` of length `n` which represents the `n` coins that you own. The value of the `ith` coin is `coins[i]`. You can **make** some value `x` if you can choose some of your `n` coins such that their values sum up to `x`.
Return the _maximum number of consecutive integer values that you *... | The abstract problem asks to count the number of disjoint pairs with a given sum k. For each possible value x, it can be paired up with k - x. The number of such pairs equals to min(count(x), count(k-x)), unless that x = k / 2, where the number of such pairs will be floor(count(x) / 2). | Array,Hash Table,Two Pointers,Sorting | Medium | 1,1830 |
905 | hello everyone welcome to day second of main eco challenge and i hope all of you are having a great time although it's monday all of us are having monday blues but no worries we still have to be consistent while with respect to solving the lead code daily problem the question that we have in today's sort array by parit... | Sort Array By Parity | length-of-longest-fibonacci-subsequence | Given an integer array `nums`, move all the even integers at the beginning of the array followed by all the odd integers.
Return _**any array** that satisfies this condition_.
**Example 1:**
**Input:** nums = \[3,1,2,4\]
**Output:** \[2,4,3,1\]
**Explanation:** The outputs \[4,2,3,1\], \[2,4,1,3\], and \[4,2,1,3\] w... | null | Array,Hash Table,Dynamic Programming | Medium | 1013 |
986 | in this video we're going to take a look at a legal problem called interval list intersection so we're given two lists of closed intervals uh first list and second list where uh first list at i is equal to start and i basically we have a start time and the end time so each intervals is pairwise disjoint and in sorted o... | Interval List Intersections | largest-time-for-given-digits | You are given two lists of closed intervals, `firstList` and `secondList`, where `firstList[i] = [starti, endi]` and `secondList[j] = [startj, endj]`. Each list of intervals is pairwise **disjoint** and in **sorted order**.
Return _the intersection of these two interval lists_.
A **closed interval** `[a, b]` (with `a... | null | String,Enumeration | Medium | null |
367 | hey guys persistent programmer here and today we're gonna do another legal question valid perfect square okay so let's understand what the problem is asking so we are given a number here and we need to find out if it's a perfect square or not and we're not allowed to use any built-in not allowed to use any built-in not... | 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 |
958 | so welcome back and this is March 15th and this is today's daily Lee code problem so today it was another binary tree question and it's honestly been the theme of the week where each problem so far they've been giving binary tree questions so this is great tree practice so what we have here is we want to see if the giv... | Check Completeness of a Binary Tree | sort-array-by-parity-ii | Given the `root` of a binary tree, determine if it is a _complete binary tree_.
In a **[complete binary tree](http://en.wikipedia.org/wiki/Binary_tree#Types_of_binary_trees)**, every level, except possibly the last, is completely filled, and all nodes in the last level are as far left as possible. It can have between ... | null | Array,Two Pointers,Sorting | Easy | 2271,2283,2327 |
41 | welcome to the coding interview question first missing positive you're given an unsorted integer array find the smallest missing positive integer this is the problem statement the constraint to this problem is that we have to solve this problem in linear time complexity and in constant space complexity for example if y... | First Missing Positive | first-missing-positive | Given an unsorted integer array `nums`, return the smallest missing positive integer.
You must implement an algorithm that runs in `O(n)` time and uses constant extra space.
**Example 1:**
**Input:** nums = \[1,2,0\]
**Output:** 3
**Explanation:** The numbers in the range \[1,2\] are all in the array.
**Example 2:*... | Think about how you would solve the problem in non-constant space. Can you apply that logic to the existing space? We don't care about duplicates or non-positive integers Remember that O(2n) = O(n) | Array,Hash Table | Hard | 268,287,448,770 |
138 | Hello guys I am Lalita Agarwal welcome tu jo on your on coding channel code flicks meet wahi you made par you so let no started let card problem aaj ki lead code ke problem kya bol rahi hai achha before going towards d problem na vani discussion par dose Those who have understood this problem well and are willing to tr... | 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 |
1,776 | hey everybody this is larry this is me going over q4 of the recently code daily or leeco contest uh car free two so basically you're given these uh you're giving these positions and there are a couple of ways to do it and i think there are apparently there are some math mathematical ways of doing this uh with respect t... | Car Fleet II | minimum-operations-to-reduce-x-to-zero | There are `n` cars traveling at different speeds in the same direction along a one-lane road. You are given an array `cars` of length `n`, where `cars[i] = [positioni, speedi]` represents:
* `positioni` is the distance between the `ith` car and the beginning of the road in meters. It is guaranteed that `positioni < ... | Think in reverse; instead of finding the minimum prefix + suffix, find the maximum subarray. Finding the maximum subarray is standard and can be done greedily. | Array,Hash Table,Binary Search,Sliding Window,Prefix Sum | Medium | 209,560,2183,2290 |
1,660 | Hai gas welcome you today's video and today we are going to do the problem of lead code 1660 whose name is correct now binary tree so let's read it once the question you have a binary tree with a small defect given it is exactly one invalid note very It's right side incorrectly points to node at D from date but to D in... | Correct a Binary Tree | thousand-separator | You have a binary tree with a small defect. There is **exactly one** invalid node where its right child incorrectly points to another node at the **same depth** but to the **invalid node's right**.
Given the root of the binary tree with this defect, `root`, return _the root of the binary tree after **removing** this i... | Scan from the back of the integer and use dots to connect blocks with length 3 except the last block. | String | Easy | null |
1,835 | Hello friends, welcome to my channel, so today we will see the problem of equal list, you will see its demand seat, today before producing, if you subscribe to my channel, please like this video so that I can comment in question a particular, I will now Now now it has been given to our village that this duty of Sarva S... | Find XOR Sum of All Pairs Bitwise AND | decode-xored-permutation | The **XOR sum** of a list is the bitwise `XOR` of all its elements. If the list only contains one element, then its **XOR sum** will be equal to this element.
* For example, the **XOR sum** of `[1,2,3,4]` is equal to `1 XOR 2 XOR 3 XOR 4 = 4`, and the **XOR sum** of `[3]` is equal to `3`.
You are given two **0-inde... | Compute the XOR of the numbers between 1 and n, and think about how it can be used. Let it be x. Think why n is odd. perm[0] = x XOR encoded[1] XOR encoded[3] XOR encoded[5] ... perm[i] = perm[i-1] XOR encoded[i-1] | Array,Bit Manipulation | Medium | null |
234 | hey there welcome back to my channel before we start please don't forget to hit that subscribe button if you want to see more coding interviews questions so in this video we'll be discussing and solving the problem palindrome Link at list so let's get started the question is that they give us a single linked list where... | Palindrome Linked List | palindrome-linked-list | Given the `head` of a singly linked list, return `true` _if it is a_ _palindrome_ _or_ `false` _otherwise_.
**Example 1:**
**Input:** head = \[1,2,2,1\]
**Output:** true
**Example 2:**
**Input:** head = \[1,2\]
**Output:** false
**Constraints:**
* The number of nodes in the list is in the range `[1, 105]`.
* ... | null | Linked List,Two Pointers,Stack,Recursion | Easy | 9,125,206,2236 |
1,903 | hi my name is david today we're going to do number 1903 largest odd number in string so we're giving a string num and it represents a large integer so in this example the num is 52 as a string and it represents the number d2 return the largest valued odd integer as a string that is a non-empty substring string that is ... | Largest Odd Number in String | design-most-recently-used-queue | You are given a string `num`, representing a large integer. Return _the **largest-valued odd** integer (as a string) that is a **non-empty substring** of_ `num`_, or an empty string_ `" "` _if no odd integer exists_.
A **substring** is a contiguous sequence of characters within a string.
**Example 1:**
**Input:** nu... | You can store the data in an array and apply each fetch by moving the ith element to the end of the array (i.e, O(n) per operation). A better way is to use the square root decomposition technique. You can build chunks of size sqrt(n). For each fetch operation, You can search for the chunk which has the ith element and ... | Array,Hash Table,Stack,Design,Binary Indexed Tree,Ordered Set | Medium | 146 |
328 | hello guys my name is lazer and today we'll be doing a lead code problem this problem is called odd even linked list given the head of a singly linked list group all the nodes with odd indices together followed by the nodes with even indices and return the reordered list so already we need to we know that we need to ke... | Odd Even Linked List | odd-even-linked-list | Given the `head` of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return _the reordered list_.
The **first** node is considered **odd**, and the **second** node is **even**, and so on.
Note that the relative order inside both the even and odd groups s... | null | Linked List | Medium | 725 |
1,893 | E agri one my name is sandeep and in this video you will show you how to solve there problem 18938 one day officer must subscribe and stands for example sentence subscribe must subscribe and stands for example sentence enter start and end that from last days do camp's one left and right 0.5 inch subscribe and right 0.5... | Check if All the Integers in a Range Are Covered | maximum-subarray-sum-after-one-operation | You are given a 2D integer array `ranges` and two integers `left` and `right`. Each `ranges[i] = [starti, endi]` represents an **inclusive** interval between `starti` and `endi`.
Return `true` _if each integer in the inclusive range_ `[left, right]` _is covered by **at least one** interval in_ `ranges`. Return `false`... | Think about dynamic programming Define an array dp[nums.length][2], where dp[i][0] is the max subarray sum including nums[i] and without squaring any element. dp[i][1] is the max subarray sum including nums[i] and having only one element squared. | Array,Dynamic Programming | Medium | 53 |
47 | hello everybody this is mustafi from zakucho and today we are going to solve another backtracking problem from lead code um this problem is uh number 47. um it's pretty similar to 46 that we already solved together and really recommend you to check 46 first and then come to solve this one so this problem statement is t... | Permutations II | permutations-ii | Given a collection of numbers, `nums`, that might contain duplicates, return _all possible unique permutations **in any order**._
**Example 1:**
**Input:** nums = \[1,1,2\]
**Output:**
\[\[1,1,2\],
\[1,2,1\],
\[2,1,1\]\]
**Example 2:**
**Input:** nums = \[1,2,3\]
**Output:** \[\[1,2,3\],\[1,3,2\],\[2,1,3\],\[2,3,... | null | Array,Backtracking | Medium | 31,46,267,1038 |
1,897 | hey everybody this is larry this is me going with q1 of the weekly contest 245 uh redistribute characters to make all strings equal so this was actually kind of tricky to um for a yeezy problem uh so hit the like button hit the subscribe button join me on discord let me know what you think about this forum because i th... | Redistribute Characters to Make All Strings Equal | maximize-palindrome-length-from-subsequences | You are given an array of strings `words` (**0-indexed**).
In one operation, pick two **distinct** indices `i` and `j`, where `words[i]` is a non-empty string, and move **any** character from `words[i]` to **any** position in `words[j]`.
Return `true` _if you can make **every** string in_ `words` _**equal** using **a... | Let's ignore the non-empty subsequence constraint. We can concatenate the two strings and find the largest palindromic subsequence with dynamic programming. Iterate through every pair of characters word1[i] and word2[j], and see if some palindrome begins with word1[i] and ends with word2[j]. This ensures that the subse... | String,Dynamic Programming | Hard | 516 |
333 | Hello friends my name is tar and today I'm going to discuss the question largest binary surch tree in a binary tree what is binary search tree is a binary tree with additional constraint that everything on the left sub tree is less than or equal to root and everything on the right sub tree is greater than root and this... | Largest BST Subtree | largest-bst-subtree | Given the root of a binary tree, find the largest subtree, which is also a Binary Search Tree (BST), where the largest means subtree has the largest number of nodes.
A **Binary Search Tree (BST)** is a tree in which all the nodes follow the below-mentioned properties:
* The left subtree values are less than the val... | You can recursively use algorithm similar to 98. Validate Binary Search Tree at each node of the tree, which will result in O(nlogn) time complexity. | Dynamic Programming,Tree,Depth-First Search,Binary Search Tree,Binary Tree | Medium | null |
142 | one so today we are looking at lead code number 142 this is a sequel to linked list cycle it's the second one link list cycle number two and this is uh somewhat similar to a regular linked list cycle except this one we want to find out where it is starting okay so let's take a look at the prompt here given a linked lis... | Linked List Cycle II | linked-list-cycle-ii | Given the `head` of a linked list, return _the node where the cycle begins. If there is no cycle, return_ `null`.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the `next` pointer. Internally, `pos` is used to denote the index of the node that ta... | null | Hash Table,Linked List,Two Pointers | Medium | 141,287 |
818 | There are definitely 108 cloves. How are you guys? If you start from Siri, then this is the series Heart Serious Questions, Tight Hard Series in the sense of loot. We will pick the top card questions, so each hard question will represent a topic, like whatever we have. Main topics which you should know in Interview Fac... | Race Car | similar-rgb-color | Your car starts at position `0` and speed `+1` on an infinite number line. Your car can go into negative positions. Your car drives automatically according to a sequence of instructions `'A'` (accelerate) and `'R'` (reverse):
* When you get an instruction `'A'`, your car does the following:
* `position += spee... | null | Math,String,Enumeration | Easy | null |
1,897 | Hello everyone welcome to my channel Kodri with Mike, so today I am going to do video number 16 of my lead code easy, okay the question is easy but we will create it in three ways, the logic will be the same but the way to implement them will be told in three different ways okay I will show you the code of both c+p and... | Redistribute Characters to Make All Strings Equal | maximize-palindrome-length-from-subsequences | You are given an array of strings `words` (**0-indexed**).
In one operation, pick two **distinct** indices `i` and `j`, where `words[i]` is a non-empty string, and move **any** character from `words[i]` to **any** position in `words[j]`.
Return `true` _if you can make **every** string in_ `words` _**equal** using **a... | Let's ignore the non-empty subsequence constraint. We can concatenate the two strings and find the largest palindromic subsequence with dynamic programming. Iterate through every pair of characters word1[i] and word2[j], and see if some palindrome begins with word1[i] and ends with word2[j]. This ensures that the subse... | String,Dynamic Programming | Hard | 516 |
417 | hey everyone in this video let's go to question 417 Pacific Atlantic water flow only code this is part of our blind 75 list of questions so let's begin in this question you are given our M by n rectangular Island that borders both the Pacific and Atlantic Ocean Pacific Ocean is basically touching the Island's left and ... | Pacific Atlantic Water Flow | pacific-atlantic-water-flow | There is an `m x n` rectangular island that borders both the **Pacific Ocean** and **Atlantic Ocean**. The **Pacific Ocean** touches the island's left and top edges, and the **Atlantic Ocean** touches the island's right and bottom edges.
The island is partitioned into a grid of square cells. You are given an `m x n` i... | null | Array,Depth-First Search,Breadth-First Search,Matrix | Medium | null |
3 | hello everyone my name is kri Nandan and today we are going to solve the lead code problem longest substring without repeating correctors okay so let's read the problem statement so here it says given a string s find the length of the longest subring without repeating characters okay here uh if you hover over the subin... | 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 |
330 | hello everybody and welcome today we're going to discuss the solution to the problem patching array it's a hard table problem although does not require any knowledge of data structures or algorithms it just requires you to understand the logic and a couple of observations will help us get there first let's discuss abou... | Patching Array | patching-array | Given a sorted integer array `nums` and an integer `n`, add/patch elements to the array such that any number in the range `[1, n]` inclusive can be formed by the sum of some elements in the array.
Return _the minimum number of patches required_.
**Example 1:**
**Input:** nums = \[1,3\], n = 6
**Output:** 1
Explanati... | null | Array,Greedy | Hard | 1930 |
224 | in this video when you look at an equal problem called basic calculator so given a string s representing a vowel expression uh implement a basic calculator to evaluate it and return the result of evaluation you are not allowed to return any or use any built-in functions that evaluates any built-in functions that evalua... | 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 |
404 | hey what's up guys is Nick white I do a lot of tech encoding stuff on Twitch in youtube if you're interested in anything about me just check the description I have everything they're doing all the Leko problems all 1,000 that are up Leko problems all 1,000 that are up Leko problems all 1,000 that are up right now so I'... | Sum of Left Leaves | sum-of-left-leaves | Given the `root` of a binary tree, return _the sum of all left leaves._
A **leaf** is a node with no children. A **left leaf** is a leaf that is the left child of another node.
**Example 1:**
**Input:** root = \[3,9,20,null,null,15,7\]
**Output:** 24
**Explanation:** There are two left leaves in the binary tree, wit... | null | Tree,Depth-First Search,Breadth-First Search,Binary Tree | Easy | null |
383 | hey hello there so I'm going to talk about today's recording challenge question it's called ransom note so the question is as follows we have a betrayal rear ends and no string and another string containing all the letters from the magazines and we want to write a function to determine whether we can construct the rans... | Ransom Note | ransom-note | Given two strings `ransomNote` and `magazine`, return `true` _if_ `ransomNote` _can be constructed by using the letters from_ `magazine` _and_ `false` _otherwise_.
Each letter in `magazine` can only be used once in `ransomNote`.
**Example 1:**
**Input:** ransomNote = "a", magazine = "b"
**Output:** false
**Example ... | null | Hash Table,String,Counting | Easy | 691 |
501 | hey everybody this is Larry this is day one of the October November Lial day challenge I'm here on top of Mount OS Shak T I'm there's no way I'm getting it right but I'm in uh in the mount asso area and basically just looking at these beautiful views and I finally climbed this hike uh and climb this Mountain hiking it ... | Find Mode in Binary Search Tree | find-mode-in-binary-search-tree | Given the `root` of a binary search tree (BST) with duplicates, return _all the [mode(s)](https://en.wikipedia.org/wiki/Mode_(statistics)) (i.e., the most frequently occurred element) in it_.
If the tree has more than one mode, return them in **any order**.
Assume a BST is defined as follows:
* The left subtree of... | null | Tree,Depth-First Search,Binary Search Tree,Binary Tree | Easy | 98 |
454 | hey guys thanks for joining in today's video we're going to take a look at problem 454 and leak code for some two so first we'll go over the problem description then we'll discuss how we can implement a solution to the problem we'll call out any edge cases we have to account for we'll discuss what kinds of data structu... | 4Sum II | 4sum-ii | Given four integer arrays `nums1`, `nums2`, `nums3`, and `nums4` all of length `n`, return the number of tuples `(i, j, k, l)` such that:
* `0 <= i, j, k, l < n`
* `nums1[i] + nums2[j] + nums3[k] + nums4[l] == 0`
**Example 1:**
**Input:** nums1 = \[1,2\], nums2 = \[-2,-1\], nums3 = \[-1,2\], nums4 = \[0,2\]
**Ou... | null | Array,Hash Table | Medium | 18 |
1,793 | hey everyone today we are going to solve theal equation maximum square of good subarray okay so first of all we have two constraints the first constraint is like we have to calculate max score with this formula so take a minimum number from index I to index J and then multiply index J minus index I + one and multiply i... | Maximum Score of a Good Subarray | minimum-moves-to-make-array-complementary | You are given an array of integers `nums` **(0-indexed)** and an integer `k`.
The **score** of a subarray `(i, j)` is defined as `min(nums[i], nums[i+1], ..., nums[j]) * (j - i + 1)`. A **good** subarray is a subarray where `i <= k <= j`.
Return _the maximum possible **score** of a **good** subarray._
**Example 1:**... | Given a target sum x, each pair of nums[i] and nums[n-1-i] would either need 0, 1, or 2 modifications. Can you find the optimal target sum x value such that the sum of modifications is minimized? Create a difference array to efficiently sum all the modifications. | Array,Hash Table,Prefix Sum | Medium | null |
347 | all right guys welcome back to another video on the derv codes channel i apologize for the last video and the annoying static that was going on anyways we're going to be solving lead code number three four seven another question on the neat code 150 list this question is top k frequent elements and essentially given an... | Top K Frequent Elements | top-k-frequent-elements | Given an integer array `nums` and an integer `k`, return _the_ `k` _most frequent elements_. You may return the answer in **any order**.
**Example 1:**
**Input:** nums = \[1,1,1,2,2,3\], k = 2
**Output:** \[1,2\]
**Example 2:**
**Input:** nums = \[1\], k = 1
**Output:** \[1\]
**Constraints:**
* `1 <= nums.lengt... | null | Array,Hash Table,Divide and Conquer,Sorting,Heap (Priority Queue),Bucket Sort,Counting,Quickselect | Medium | 192,215,451,659,692,1014,1919 |
1,197 | hey guys how's everything going today let's take a look at number one 197 minimum light moves this is one of my videos that I'm going to use to prepare for my fifth Facebook interview in June so hope it helps myself or and I hope it helps you so we're given an infinite chessboard with the coordinates from infinity to i... | Minimum Knight Moves | parsing-a-boolean-expression | In an **infinite** chess board with coordinates from `-infinity` to `+infinity`, you have a **knight** at square `[0, 0]`.
A knight has 8 possible moves it can make, as illustrated below. Each move is two squares in a cardinal direction, then one square in an orthogonal direction.
Return _the minimum number of steps ... | Write a function "parse" which calls helper functions "parse_or", "parse_and", "parse_not". | String,Stack,Recursion | Hard | null |
1,503 | Hello Hi Everybody Welcome To My Channel It's All The Problem 1503 Last Moment With All And Fall Of Playing Subha Hai Western Flank Of The Land And Unison And Share Broking Gond Appling Inch And Moves With Speed One Unit Per Second Some Of The Year And Speed One Unit Per Second Some Of The Year And Speed One Unit... | Last Moment Before All Ants Fall Out of a Plank | reducing-dishes | We have a wooden plank of the length `n` **units**. Some ants are walking on the plank, each ant moves with a speed of **1 unit per second**. Some of the ants move to the **left**, the other move to the **right**.
When two ants moving in two **different** directions meet at some point, they change their directions and... | Use dynamic programming to find the optimal solution by saving the previous best like-time coefficient and its corresponding element sum. If adding the current element to the previous best like-time coefficient and its corresponding element sum would increase the best like-time coefficient, then go ahead and add it. Ot... | Array,Dynamic Programming,Greedy,Sorting | Hard | null |
102 | looking at lead code number 102 binary tree level order traversal we're going to use a template to solve this and we're going to solve a bunch of questions that deal with level order breadth first search traversals using this template so uh if you are having trouble with this is a good way to kind of memorize one patte... | Binary Tree Level Order Traversal | binary-tree-level-order-traversal | Given the `root` of a binary tree, return _the level order traversal of its nodes' values_. (i.e., from left to right, level by level).
**Example 1:**
**Input:** root = \[3,9,20,null,null,15,7\]
**Output:** \[\[3\],\[9,20\],\[15,7\]\]
**Example 2:**
**Input:** root = \[1\]
**Output:** \[\[1\]\]
**Example 3:**
**I... | null | Tree,Breadth-First Search,Binary Tree | Medium | 103,107,111,314,637,764,1035 |
1,007 | hey guys welcome back to another video and today we're going to be solving the leakout question minimum domino rotations for an equal row all right so in a row of dominoes a i and bi represent the top and bottom halves of the eighth dominum a domino is a tile with two numbers from one through six and one of each half o... | Minimum Domino Rotations For Equal Row | numbers-with-same-consecutive-differences | In a row of dominoes, `tops[i]` and `bottoms[i]` represent the top and bottom halves of the `ith` domino. (A domino is a tile with two numbers from 1 to 6 - one on each half of the tile.)
We may rotate the `ith` domino, so that `tops[i]` and `bottoms[i]` swap values.
Return the minimum number of rotations so that all... | null | Backtracking,Breadth-First Search | Medium | null |
991 | hello everyone today we are going to solve a broken calculator lead code medium level problem so in this problem we are given within a start value it is an integer which is a display on and calculator and we can do two operation on that calculator first is we can multiply the number by two or we can subtract the number... | Broken Calculator | array-of-doubled-pairs | There is a broken calculator that has the integer `startValue` on its display initially. In one operation, you can:
* multiply the number on display by `2`, or
* subtract `1` from the number on display.
Given two integers `startValue` and `target`, return _the minimum number of operations needed to display_ `targ... | null | Array,Hash Table,Greedy,Sorting | Medium | 2117 |
292 | welcome back for another video we are going to do another deco question the question is 292 lingan you are playing the following lin game with your friend initially there is a heap of stones on the table you and your friend will alternate taking turns and you go first on each tongue the person whose tongue is will remo... | Nim Game | nim-game | You are playing the following Nim Game with your friend:
* Initially, there is a heap of stones on the table.
* You and your friend will alternate taking turns, and **you go first**.
* On each turn, the person whose turn it is will remove 1 to 3 stones from the heap.
* The one who removes the last stone is the... | If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner? | Math,Brainteaser,Game Theory | Easy | 294 |
5 | question five leak code longest panoramic substring so given a string s return the longest panoramic substring in s so in example one we have b a d and the output is b a b so palindrome reads the same forward as it does backwards and we need to find the longest palindromic substring within the string s so here the outp... | Longest Palindromic Substring | longest-palindromic-substring | Given a string `s`, return _the longest_ _palindromic_ _substring_ in `s`.
**Example 1:**
**Input:** s = "babad "
**Output:** "bab "
**Explanation:** "aba " is also a valid answer.
**Example 2:**
**Input:** s = "cbbd "
**Output:** "bb "
**Constraints:**
* `1 <= s.length <= 1000`
* `s` consist of only dig... | How can we reuse a previously computed palindrome to compute a larger palindrome? If “aba” is a palindrome, is “xabax” a palindrome? Similarly is “xabay” a palindrome? Complexity based hint:
If we use brute-force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end ... | String,Dynamic Programming | Medium | 214,266,336,516,647 |
344 | what's up youtube today we're going to take a look at lead code problem number 344 reverse string marked is easy let's get into it so there's a couple new things here i have a new chair new camera new haircut gotta get used to all of these things and i also wanted to start a new series going through the lead code algor... | Reverse String | reverse-string | Write a function that reverses a string. The input string is given as an array of characters `s`.
You must do this by modifying the input array [in-place](https://en.wikipedia.org/wiki/In-place_algorithm) with `O(1)` extra memory.
**Example 1:**
**Input:** s = \["h","e","l","l","o"\]
**Output:** \["o","l","l","e","h... | The entire logic for reversing a string is based on using the opposite directional two-pointer approach! | Two Pointers,String,Recursion | Easy | 345,541 |
1,010 | hey what's up guys so let's solve this one zero pair of zones with dildo directions so basically you got an array and uh each array is time i and you need to find a pair uh you can find number of pairs i and j such that s and j and their sum is six divisible by 60. but this problem is exactly the same as two sum right ... | Pairs of Songs With Total Durations Divisible by 60 | powerful-integers | You are given a list of songs where the `ith` song has a duration of `time[i]` seconds.
Return _the number of pairs of songs for which their total duration in seconds is divisible by_ `60`. Formally, we want the number of indices `i`, `j` such that `i < j` with `(time[i] + time[j]) % 60 == 0`.
**Example 1:**
**Input... | null | Hash Table,Math | Medium | null |
48 | Hello friends, welcome to the new video, question number 48 in the list is a rotate image medium level question, this is the question, you guys will get an interview with it has been asked in Google Facebook Amazon by the name Rotate Matric, let's start the yagya. Today matrix whose size and so and have to * can be 323... | Rotate Image | rotate-image | You are given an `n x n` 2D `matrix` representing an image, rotate the image by **90** degrees (clockwise).
You have to rotate the image [**in-place**](https://en.wikipedia.org/wiki/In-place_algorithm), which means you have to modify the input 2D matrix directly. **DO NOT** allocate another 2D matrix and do the rotati... | null | Array,Math,Matrix | Medium | 2015 |
10 | What happened in this video, we have this registration matching name, Kashmir valley has a very interesting question, the question is, you have got this team, now you have got Mississippi for stitching, Ajay has got this pattern and you have got this pattern, it is my time that the star comes. Dot Servi gives you this ... | 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 |
61 | A higher oil welcome to learn to repeat step is exactly the same day Vinod Tubelight challenge the name of the problem eroded list electronic products given link list voter list various bike places where is not getting a co select login the example software 's is to end Villages 12345 After Five 's is to end Villages 1... | Rotate List | rotate-list | Given the `head` of a linked list, rotate the list to the right by `k` places.
**Example 1:**
**Input:** head = \[1,2,3,4,5\], k = 2
**Output:** \[4,5,1,2,3\]
**Example 2:**
**Input:** head = \[0,1,2\], k = 4
**Output:** \[2,0,1\]
**Constraints:**
* The number of nodes in the list is in the range `[0, 500]`.
* ... | null | Linked List,Two Pointers | Medium | 189,725 |
807 | hi-oh in this video we'll solve the lead hi-oh in this video we'll solve the lead hi-oh in this video we'll solve the lead code problem number 807 maximum increase to keep city skyline okay so we have the view from all of the angles from top bottom left and right the first thing we need to understand is that the view f... | Max Increase to Keep City Skyline | custom-sort-string | There is a city composed of `n x n` blocks, where each block contains a single building shaped like a vertical square prism. You are given a **0-indexed** `n x n` integer matrix `grid` where `grid[r][c]` represents the **height** of the building located in the block at row `r` and column `c`.
A city's **skyline** is t... | null | Hash Table,String,Sorting | Medium | null |
138 | video and turkey league pokal kapellen smith rambler so good basically because how to criticize home version of this english and can see that this english house a random pointer punctual and a jew in the lingua guy swinnen show you how we computer service come her stable in this video a little creative idea for shows i... | 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 |
228 | A Higher Oil Welcome To Line Ko Dp Also 26 Big Bills Boxing Saturday 28th Shooter Playlist Ko Challenge Religion We Have Problem Summary Ranges Networking Problem The Points Your Arguments For Kids In Interior AIIMS Return 10 - Hotel Staff Changes Interior AIIMS Return 10 - Hotel Staff Changes Interior AIIMS Return 10 ... | Summary Ranges | summary-ranges | You are given a **sorted unique** integer array `nums`.
A **range** `[a,b]` is the set of all integers from `a` to `b` (inclusive).
Return _the **smallest sorted** list of ranges that **cover all the numbers in the array exactly**_. That is, each element of `nums` is covered by exactly one of the ranges, and there is... | null | Array | Easy | 163,352 |
47 | hi everyone today i saw the code question called permutation 2 so given collection numbers nouns that might contain duplicates we want to return all possible unique permutations in other words permutation without duplicates in any order so see the difference between permutation one permutation two uh implementation one... | Permutations II | permutations-ii | Given a collection of numbers, `nums`, that might contain duplicates, return _all possible unique permutations **in any order**._
**Example 1:**
**Input:** nums = \[1,1,2\]
**Output:**
\[\[1,1,2\],
\[1,2,1\],
\[2,1,1\]\]
**Example 2:**
**Input:** nums = \[1,2,3\]
**Output:** \[\[1,2,3\],\[1,3,2\],\[2,1,3\],\[2,3,... | null | Array,Backtracking | Medium | 31,46,267,1038 |
231 | hey this is Topher with the lonely Dash and today we're going over lead code question 231 power of two which states given an integer n return true if it's a power of two otherwise return false if an integer N is a power of two there exists an integer X such that n is equal to 2 to the X power okay so what does this rea... | Power of Two | power-of-two | Given an integer `n`, return _`true` if it is a power of two. Otherwise, return `false`_.
An integer `n` is a power of two, if there exists an integer `x` such that `n == 2x`.
**Example 1:**
**Input:** n = 1
**Output:** true
**Explanation:** 20 = 1
**Example 2:**
**Input:** n = 16
**Output:** true
**Explanation:**... | null | Math,Bit Manipulation,Recursion | Easy | 191,326,342 |
266 | hey what's up guys new white here I do technical stuff on twitching YouTube check the description for all my information go to patreon and I do the premium Lea code solutions there and then reach out to me on discord if you want to try and respond to everyone 266 palindrome permutation got some likes we did palindrome ... | Palindrome Permutation | palindrome-permutation | Given a string `s`, return `true` _if a permutation of the string could form a_ _**palindrome**_ _and_ `false` _otherwise_.
**Example 1:**
**Input:** s = "code "
**Output:** false
**Example 2:**
**Input:** s = "aab "
**Output:** true
**Example 3:**
**Input:** s = "carerac "
**Output:** true
**Constraints:**
... | Consider the palindromes of odd vs even length. What difference do you notice? Count the frequency of each character. If each character occurs even number of times, then it must be a palindrome. How about character which occurs odd number of times? | Hash Table,String,Bit Manipulation | Easy | 5,242,267,409 |
504 | hey everyone welcome back and today we'll be doing another lead code 504 ps7 and easy one given integer num return a string with its base summer representation so this is a an easy one you know how we used to do a binary you can say representation we just divided by two and if the remainder is 0 then we have 0 and we a... | Base 7 | base-7 | Given an integer `num`, return _a string of its **base 7** representation_.
**Example 1:**
**Input:** num = 100
**Output:** "202"
**Example 2:**
**Input:** num = -7
**Output:** "-10"
**Constraints:**
* `-107 <= num <= 107` | null | Math | Easy | null |
215 | um today we'll see how to solve the gate largest element in anime so here again array without sorting and we want to indicate largest element if K is 1 means we need to find the last element in the ascending sorted array good if it's 2 we wouldn't find the element which is second from last in the ascending circles arra... | Kth Largest Element in an Array | kth-largest-element-in-an-array | Given an integer array `nums` and an integer `k`, return _the_ `kth` _largest element in the array_.
Note that it is the `kth` largest element in the sorted order, not the `kth` distinct element.
You must solve it in `O(n)` time complexity.
**Example 1:**
**Input:** nums = \[3,2,1,5,6,4\], k = 2
**Output:** 5
**Ex... | null | Array,Divide and Conquer,Sorting,Heap (Priority Queue),Quickselect | Medium | 324,347,414,789,1014,2113,2204,2250 |
232 | for some reason this problem is very popular I guess that is because it Gorges your mental flexibility and how can you come up with new Solutions using only the existing resources this is very crucial because indeed you have to implement a q data structure using only the Stag data structure so let's see what we can do ... | Implement Queue using Stacks | implement-queue-using-stacks | Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (`push`, `peek`, `pop`, and `empty`).
Implement the `MyQueue` class:
* `void push(int x)` Pushes element x to the back of the queue.
* `int pop()` Removes the element from th... | null | Stack,Design,Queue | Easy | 225 |
497 | hello guys welcome to algorithms made easy today we will go through the day 22 problem from august coding challenge random point in non overlapping rectangles please like the video and if you are new don't forget to subscribe to our channel so that you never miss any update given a list of non-overlapping access given ... | Random Point in Non-overlapping Rectangles | random-point-in-non-overlapping-rectangles | You are given an array of non-overlapping axis-aligned rectangles `rects` where `rects[i] = [ai, bi, xi, yi]` indicates that `(ai, bi)` is the bottom-left corner point of the `ith` rectangle and `(xi, yi)` is the top-right corner point of the `ith` rectangle. Design an algorithm to pick a random integer point inside th... | null | null | Medium | null |
1,247 | hello so continuing today on this contest 161 athlete code this problem is called minimum swabs to make streams equal and so the problem says we get two shrinks s1 and s2 that are of equal length that have letters only letters x and y in them so this is important only x and y letters and that our task is to make these ... | Minimum Swaps to Make Strings Equal | decrease-elements-to-make-array-zigzag | You are given two strings `s1` and `s2` of equal length consisting of letters `"x "` and `"y "` **only**. Your task is to make these two strings equal to each other. You can swap any two characters that belong to **different** strings, which means: swap `s1[i]` and `s2[j]`.
Return the minimum number of swaps required ... | Do each case (even indexed is greater, odd indexed is greater) separately. In say the even case, you should decrease each even-indexed element until it is lower than its immediate neighbors. | Array,Greedy | Medium | null |
1,675 | hello everyone welcome today we are looking at another lead code question which is minimum deviation in array now in this question we are given another nums and it has n positive integers and we can perform two types of operations one if the element is even then divided by two for example one two three four where four ... | Minimize Deviation in Array | magnetic-force-between-two-balls | You are given an array `nums` of `n` positive integers.
You can perform two types of operations on any element of the array any number of times:
* If the element is **even**, **divide** it by `2`.
* For example, if the array is `[1,2,3,4]`, then you can do this operation on the last element, and the array wil... | If you can place balls such that the answer is x then you can do it for y where y < x. Similarly if you cannot place balls such that the answer is x then you can do it for y where y > x. Binary search on the answer and greedily see if it is possible. | Array,Binary Search,Sorting | Medium | 2188 |
455 | Hello everyone, my name is Ayush Mishra and Education Course, today we are going to talk about the product of Aasan on Play List, the problem is very sweet, here we will see two approaches, if the first approach, I will call you here. I will tell you and give other ideas which will make you understand something. After ... | Assign Cookies | assign-cookies | Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.
Each child `i` has a greed factor `g[i]`, which is the minimum size of a cookie that the child will be content with; and each cookie `j` has a size `s[j]`. If `s[j] >= g[i]`, we can assign ... | null | Array,Greedy,Sorting | Easy | null |
1,704 | Everyone welcome back in the video and in this video we will see string based problem so this is an easy question of lead code so let us directly see the example and understand then in this problem we will be given a string, suppose the first string given to us is let. From the book and whatever the length of the strin... | Determine if String Halves Are Alike | special-positions-in-a-binary-matrix | You are given a string `s` of even length. Split this string into two halves of equal lengths, and let `a` be the first half and `b` be the second half.
Two strings are **alike** if they have the same number of vowels (`'a'`, `'e'`, `'i'`, `'o'`, `'u'`, `'A'`, `'E'`, `'I'`, `'O'`, `'U'`). Notice that `s` contains uppe... | Keep track of 1s in each row and in each column. Then while iterating over matrix, if the current position is 1 and current row as well as current column contains exactly one occurrence of 1. | Array,Matrix | Easy | null |
1,614 | hello everyone welcome to harsha lectures in this lecture i am going to explain you about maximum net nesting depth of the parenthesis so here a string is a valid parenthesis string if it meets one of the following so here what they mentioned is we need to find out maximum nesting depth of the parenthesis for example h... | Maximum Nesting Depth of the Parentheses | maximum-nesting-depth-of-the-parentheses | A string is a **valid parentheses string** (denoted **VPS**) if it meets one of the following:
* It is an empty string `" "`, or a single character not equal to `"( "` or `") "`,
* It can be written as `AB` (`A` concatenated with `B`), where `A` and `B` are **VPS**'s, or
* It can be written as `(A)`, where `A` i... | null | null | Easy | null |
872 | long time the reason being we have already solved most of the questions that come in Daily de code problem today I found an portunity this question I haven't solved it in the past rest all those that have been coming along guys do check out coding decoded YouTube channel you'll find them there if not then I promise I'l... | Leaf-Similar Trees | split-array-into-fibonacci-sequence | Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a **leaf value sequence**_._
For example, in the given tree above, the leaf value sequence is `(6, 7, 4, 9, 8)`.
Two binary trees are considered _leaf-similar_ if their leaf value sequence is the same.
Return `true` i... | null | String,Backtracking | Medium | 306,1013 |
979 | Hello Hi Guys Welcome To My Channel Beauty Parlor Doing So In This Video Will Do Some List Co Problems And Also Be Doing A Dynamic Programming Problems Will Complete Directly Robot Tyou Edit Co Problems And Whose Turnover Is Not Hearing Date Sheet For A Third Bell Icon Posts 216 Tasty Certain Problems Aa A Solid Proble... | Distribute Coins in Binary Tree | di-string-match | You are given the `root` of a binary tree with `n` nodes where each `node` in the tree has `node.val` coins. There are `n` coins in total throughout the whole tree.
In one move, we may choose two adjacent nodes and move one coin from one node to another. A move may be from parent to child, or from child to parent.
Re... | null | Array,Math,Two Pointers,String,Greedy | Easy | null |
438 | hello everyone today's questions is find all anagrams in a string given a string s and a non empty string P find all the start indices of piece anagram in s first we will understand these questions and then we will move to the solution part so what we have to do according to our questions we have to find all start inde... | Find All Anagrams in a String | find-all-anagrams-in-a-string | Given two strings `s` and `p`, return _an array of all the start indices of_ `p`_'s anagrams in_ `s`. You may return the answer in **any order**.
An **Anagram** is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
**Example 1:**
*... | null | Hash Table,String,Sliding Window | Medium | 242,567 |
1,171 | hello everyone welcome to my youth programming club today we will be solving another daily Le code problem and the problem's name is remove zero some consecutive notes from link list so let me describe this problem statement in my own words so what you will be given is you will be given a singly link list okay so let's... | Remove Zero Sum Consecutive Nodes from Linked List | shortest-path-in-binary-matrix | Given the `head` of a linked list, we repeatedly delete consecutive sequences of nodes that sum to `0` until there are no such sequences.
After doing so, return the head of the final linked list. You may return any such answer.
(Note that in the examples below, all sequences are serializations of `ListNode` objects.)... | Do a breadth first search to find the shortest path. | Array,Breadth-First Search,Matrix | Medium | null |
559 | hey everyone welcome back and today we will be doing another lead code problem 559 maximum depth of an erratri an easy one given an anarch tree find its maximum depth the maximum depth is the number of nodes along the longest pass from root node down to the further as Leaf node the an array input serialization is repre... | Maximum Depth of N-ary Tree | maximum-depth-of-n-ary-tree | Given a n-ary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
_Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples)._
**Example... | null | null | Easy | null |
784 | hello and welcome to devflix I hope you guys are doing great so today we are gonna see problem number 784 letter case permutation so let's get started given a string yes you can transform every letter individually to be a lowercase or uppercase to create another string written a list of all possible strings we could cr... | Letter Case Permutation | insert-into-a-binary-search-tree | Given a string `s`, you can transform every letter individually to be lowercase or uppercase to create another string.
Return _a list of all possible strings we could create_. Return the output in **any order**.
**Example 1:**
**Input:** s = "a1b2 "
**Output:** \[ "a1b2 ", "a1B2 ", "A1b2 ", "A1B2 "\]
**Example 2:*... | null | Tree,Binary Search Tree,Binary Tree | Medium | 783 |
72 | given two strings word one and word two return the minimum number of operations required to convert word one to word two you have the following three options permitted on a word insert a character deletes a character and replace a character so our objective is to get from word one to word two with some number of operat... | 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 |
987 | hey everybody this is larry this is day seven of the august leeco daily challenge uh hit the like button hit the subscribe button and join me on discord and let's get started in today's forum vertical order traversal of a binary tree given a binary tree we turn the vertical order towards of his node value okay so three... | Vertical Order Traversal of a Binary Tree | reveal-cards-in-increasing-order | Given the `root` of a binary tree, calculate the **vertical order traversal** of the binary tree.
For each node at position `(row, col)`, its left and right children will be at positions `(row + 1, col - 1)` and `(row + 1, col + 1)` respectively. The root of the tree is at `(0, 0)`.
The **vertical order traversal** o... | null | Array,Queue,Sorting,Simulation | Medium | null |
1,027 | Hai gas welcome you me youtube video today we are going to daily need per challenge and today problem name is this longest arithmetic sub statement so d problem statement of integers return d length of d longest arithmetic sub sequence in lamps what have we been told question is and we Longest alphabetical sequence you... | Longest Arithmetic Subsequence | sum-of-even-numbers-after-queries | Given an array `nums` of integers, return _the length of the longest arithmetic subsequence in_ `nums`.
**Note** that:
* A **subsequence** is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.
* A sequence `seq` is arithmetic if `s... | null | Array,Simulation | Medium | null |
337 | Ajay Ko Hello friends calling on dynasty sites and in today's video we will solve a problem named House Robin Thicke so first let us understand this problem and then we will see how to normalize it. Okay now so I have an example. Point becomes this, now see a proper is happening, I have a thief who is fine, what is he ... | 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 |
299 | hello welcome to something called today we are going to saw the day 10 of september equal challenge today's problem name is bulls and cows okay so let's try to understand the problems statement first then we will try to see the given example then we will try to design one solution for the same okay so what they are say... | Bulls and Cows | bulls-and-cows | You are playing the **[Bulls and Cows](https://en.wikipedia.org/wiki/Bulls_and_Cows)** game with your friend.
You write down a secret number and ask your friend to guess what the number is. When your friend makes a guess, you provide a hint with the following info:
* The number of "bulls ", which are digits in the ... | null | Hash Table,String,Counting | Medium | null |
1 | hi guys in this video we look at to some problem so let's see what the problem is so we're given an array of integers and in that we need to find indices of two number such that they add up to a specific target so let's see what the assumptions that we can take so there is one only one possible solution and we cannot u... | Two Sum | two-sum | Given an array of integers `nums` and an integer `target`, return _indices of the two numbers such that they add up to `target`_.
You may assume that each input would have **_exactly_ one solution**, and you may not use the _same_ element twice.
You can return the answer in any order.
**Example 1:**
**Input:** nums... | A really brute force way would be to search for all possible pairs of numbers but that would be too slow. Again, it's best to try out brute force solutions for just for completeness. It is from these brute force solutions that you can come up with optimizations. So, if we fix one of the numbers, say x, we have to scan ... | Array,Hash Table | Easy | 15,18,167,170,560,653,1083,1798,1830,2116,2133,2320 |
1,528 | welcome comrades to this video we're going to do a lee code challenge in python this one is called the shuffle string i'm going to skip the description because i'm going to explain it through the explanation so if you're doing this problem it's good to read through that but first i'll do the explanation of how it works... | Shuffle String | kids-with-the-greatest-number-of-candies | You are given a string `s` and an integer array `indices` of the **same length**. The string `s` will be shuffled such that the character at the `ith` position moves to `indices[i]` in the shuffled string.
Return _the shuffled string_.
**Example 1:**
**Input:** s = "codeleet ", `indices` = \[4,5,6,7,0,2,1,3\]
**Out... | Use greedy approach. For each kid check if candies[i] + extraCandies ≥ maximum in Candies[i]. | Array | Easy | null |
1,976 | hello welcome today I try to solve another difficult problem 1976 number of ways to arrive at destination so we are just giving a graph structure so this road means from not U to not way with a cost of seven so this seven means time and this n is the total number of nods we just need to calculate how many SS pass from ... | Number of Ways to Arrive at Destination | splitting-a-string-into-descending-consecutive-values | You are in a city that consists of `n` intersections numbered from `0` to `n - 1` with **bi-directional** roads between some intersections. The inputs are generated such that you can reach any intersection from any other intersection and that there is at most one road between any two intersections.
You are given an in... | One solution is to try all possible splits using backtrack Look out for trailing zeros in string | String,Backtracking | Medium | null |
414 | welcome back everyone to another video here in the unknown code YouTube channel today we have another Elite code problem this time 414 third maximum number this one is a little bit simpler one and it should be a lot easier to explain than the last episode and this problem states that we're given an integer array called... | Third Maximum Number | third-maximum-number | Given an integer array `nums`, return _the **third distinct maximum** number in this array. If the third maximum does not exist, return the **maximum** number_.
**Example 1:**
**Input:** nums = \[3,2,1\]
**Output:** 1
**Explanation:**
The first distinct maximum is 3.
The second distinct maximum is 2.
The third distin... | null | Array,Sorting | Easy | 215 |
82 | Hello Guys Welcome To My Interesting Video 10 Leaves Of Coding School Remove Duplicate From Haunted Place Were Given All In Places In All Value Certificate For Example In Real Consistency 314 Advances Money 1282 Digit Drum And A Trident Nariman In English Suvichar English Saving Element 1215 Tunic High Job Morgan 122 W... | Remove Duplicates from Sorted List II | remove-duplicates-from-sorted-list-ii | Given the `head` of a sorted linked list, _delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list_. Return _the linked list **sorted** as well_.
**Example 1:**
**Input:** head = \[1,2,3,3,4,4,5\]
**Output:** \[1,2,5\]
**Example 2:**
**Input:** head = \[1,1,1,2,3\]
**Outpu... | null | Linked List,Two Pointers | Medium | 83,1982 |
77 | So hello gas welcome tu de new video so in this video we are going to talk about let code 77 number problem which is its combinations so this problem also we are going to do with back tracking so why am I going to do with back tracking simple c The thing is, I came and saw the constant, okay, the constraint is very low... | Combinations | combinations | Given two integers `n` and `k`, return _all possible combinations of_ `k` _numbers chosen from the range_ `[1, n]`.
You may return the answer in **any order**.
**Example 1:**
**Input:** n = 4, k = 2
**Output:** \[\[1,2\],\[1,3\],\[1,4\],\[2,3\],\[2,4\],\[3,4\]\]
**Explanation:** There are 4 choose 2 = 6 total combin... | null | Backtracking | Medium | 39,46 |
1,342 | okay guys let's go over 1342 number of steps the problem says given a non negative so the number is greater than zero integer number returned the number of steps to reduce it to zero so whatever number we have you want to reduce it to until we get zero and we want to count how many times it took if the current number i... | Number of Steps to Reduce a Number to Zero | queens-that-can-attack-the-king | Given an integer `num`, return _the number of steps to reduce it to zero_.
In one step, if the current number is even, you have to divide it by `2`, otherwise, you have to subtract `1` from it.
**Example 1:**
**Input:** num = 14
**Output:** 6
**Explanation:**
Step 1) 14 is even; divide by 2 and obtain 7.
Step 2) 7... | Check 8 directions around the King. Find the nearest queen in each direction. | Array,Matrix,Simulation | Medium | null |
3 | hi guys hope you're doing great today's question is longest substring without repeating characters it's a medium level question and one of the top like problems on decode so the question says given a string find the length of the longest substring without repeating characters substring means we cannot have permutations... | 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 |
167 | hi today i will be solving a follow-up hi today i will be solving a follow-up hi today i will be solving a follow-up to the two-sum to the two-sum to the two-sum problem this algorithm is essential in implementing the optimal solutions to another two popular interview questions three sum and four sum all right let's ge... | Two Sum II - Input Array Is Sorted | two-sum-ii-input-array-is-sorted | Given a **1-indexed** array of integers `numbers` that is already **_sorted in non-decreasing order_**, find two numbers such that they add up to a specific `target` number. Let these two numbers be `numbers[index1]` and `numbers[index2]` where `1 <= index1 < index2 <= numbers.length`.
Return _the indices of the two n... | null | Array,Two Pointers,Binary Search | Medium | 1,653,1083 |
548 | let's go to question number 548 split already with equal sum this is medium question let's get into it kevin array with an integers you need to find if there are three fleet ijk which satisfies following condition first i must be bigger than zero and then j must be bigger than i plus one and then k must be bigger than ... | Split Array with Equal Sum | split-array-with-equal-sum | Given an integer array `nums` of length `n`, return `true` if there is a triplet `(i, j, k)` which satisfies the following conditions:
* `0 < i, i + 1 < j, j + 1 < k < n - 1`
* The sum of subarrays `(0, i - 1)`, `(i + 1, j - 1)`, `(j + 1, k - 1)` and `(k + 1, n - 1)` is equal.
A subarray `(l, r)` represents a sli... | null | Array,Prefix Sum | Hard | 1678 |
989 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem add to array form of integer so we're given the array form of an integer num for example the number 1200 would be represented in an array like this is the array form of that integer each digit is going to get its own po... | Add to Array-Form of Integer | largest-component-size-by-common-factor | The **array-form** of an integer `num` is an array representing its digits in left to right order.
* For example, for `num = 1321`, the array form is `[1,3,2,1]`.
Given `num`, the **array-form** of an integer, and an integer `k`, return _the **array-form** of the integer_ `num + k`.
**Example 1:**
**Input:** num ... | null | Array,Math,Union Find | Hard | 2276 |
448 | all right so welcome back and this is question 448 and it's called find all numbers disappeared in an array and so for this question we are given a nums array and in this case we are given an array of length eight and so the question wants us to go through this array and find all the missing or disappeared numbers and ... | Find All Numbers Disappeared in an Array | find-all-numbers-disappeared-in-an-array | Given an array `nums` of `n` integers where `nums[i]` is in the range `[1, n]`, return _an array of all the integers in the range_ `[1, n]` _that do not appear in_ `nums`.
**Example 1:**
**Input:** nums = \[4,3,2,7,8,2,3,1\]
**Output:** \[5,6\]
**Example 2:**
**Input:** nums = \[1,1\]
**Output:** \[2\]
**Constrain... | This is a really easy problem if you decide to use additional memory. For those trying to write an initial solution using additional memory, think counters! However, the trick really is to not use any additional space than what is already available to use. Sometimes, multiple passes over the input array help find the s... | Array,Hash Table | Easy | 41,442,2107,2305 |
956 | hey everybody this is Larry this is day 24 of difficult day challenge hit the like button hit the Subscribe button drummer Discord let me know what you think about today's poem 956 tonis billboard it's okay yeah I'm still in this bin I'm just hanging out uh yeah let's check out this car oh ah man okay so install billbo... | Tallest Billboard | number-of-music-playlists | You are installing a billboard and want it to have the largest height. The billboard will have two steel supports, one on each side. Each steel support must be an equal height.
You are given a collection of `rods` that can be welded together. For example, if you have rods of lengths `1`, `2`, and `3`, you can weld the... | null | Math,Dynamic Programming,Combinatorics | Hard | null |
269 | foreign hi my name is Jasmine and welcome to another tutorial today we're going to be going over a problem called alien dictionary from leak code it is classified as hard and was asked by many big tech companies such as Google Amazon Airbnb Uber and many more so let's start with reading the problem description so we ha... | Alien Dictionary | alien-dictionary | There is a new alien language that uses the English alphabet. However, the order among the letters is unknown to you.
You are given a list of strings `words` from the alien language's dictionary, where the strings in `words` are **sorted lexicographically** by the rules of this new language.
Return _a string of the u... | null | Array,String,Depth-First Search,Breadth-First Search,Graph,Topological Sort | Hard | 210 |
201 | Hello Welcome to Delhi Distance Between Suzy Under Dividend of Numbers subscribe to subscribe the Channel Please subscribe and subscribe this Video plz subscribe Ki Between Us and of Numbers Riched Ko 2010 Electronic Chronic Problem The Video then subscribe to the Page if you liked The Video then subscribe to subscribe... | Bitwise AND of Numbers Range | bitwise-and-of-numbers-range | Given two integers `left` and `right` that represent the range `[left, right]`, return _the bitwise AND of all numbers in this range, inclusive_.
**Example 1:**
**Input:** left = 5, right = 7
**Output:** 4
**Example 2:**
**Input:** left = 0, right = 0
**Output:** 0
**Example 3:**
**Input:** left = 1, right = 2147... | null | Bit Manipulation | Medium | null |
1,845 | Hello friends welcome to my channel here solve L quot problems and prepare to the C interview today the problem number is 1845 C reservation manager design a system that manages the reservation state of end seeds that are numbered from 1 to n implement the seat manager class seat manager iniz a seat manager object that... | Seat Reservation Manager | largest-submatrix-with-rearrangements | Design a system that manages the reservation state of `n` seats that are numbered from `1` to `n`.
Implement the `SeatManager` class:
* `SeatManager(int n)` Initializes a `SeatManager` object that will manage `n` seats numbered from `1` to `n`. All seats are initially available.
* `int reserve()` Fetches the **sm... | For each column, find the number of consecutive ones ending at each position. For each row, sort the cumulative ones in non-increasing order and "fit" the largest submatrix. | Array,Greedy,Sorting,Matrix | Medium | 695 |
52 | hello guys today we are going to see the uh question n Queens 2 the N Queens puzzle is the problem of placing the N Queens on N cross and Chase board such that no two queens attack each other for two queens not to attack each other so uh we know that Queen can move in all the e Direction so we need to check that uh bot... | N-Queens II | n-queens-ii | The **n-queens** puzzle is the problem of placing `n` queens on an `n x n` chessboard such that no two queens attack each other.
Given an integer `n`, return _the number of distinct solutions to the **n-queens puzzle**_.
**Example 1:**
**Input:** n = 4
**Output:** 2
**Explanation:** There are two distinct solutions ... | null | Backtracking | Hard | 51 |
1,732 | hey guys in today's video we are going to solve one more lead good question that is question number 1732 find the highest altitude this is an easy level question and we can see it has been asked by Adobe apple and Microsoft in last two years so let's see what this question is all about and how we can solve this so in t... | Find the Highest Altitude | minimum-one-bit-operations-to-make-integers-zero | There is a biker going on a road trip. The road trip consists of `n + 1` points at different altitudes. The biker starts his trip on point `0` with altitude equal `0`.
You are given an integer array `gain` of length `n` where `gain[i]` is the **net gain in altitude** between points `i` and `i + 1` for all (`0 <=... | The fastest way to convert n to zero is to remove all set bits starting from the leftmost one. Try some simple examples to learn the rule of how many steps are needed to remove one set bit. consider n=2^k case first, then solve for all n. | Dynamic Programming,Bit Manipulation,Memoization | Hard | 2119 |
1,696 | hey there welcome back to lead coding i'm your host faraz and today we will be looking at the third problem from lead code weekly contest 220. so name of the problem is jump game six we have already solved jump game five if you haven't watched the video the link will be in the description you can go and watch that vide... | Jump Game VI | strange-printer-ii | You are given a **0-indexed** integer array `nums` and an integer `k`.
You are initially standing at index `0`. In one move, you can jump at most `k` steps forward without going outside the boundaries of the array. That is, you can jump from index `i` to any index in the range `[i + 1, min(n - 1, i + k)]` **inclusive*... | Try thinking in reverse. Given the grid, how can you tell if a colour was painted last? | Array,Graph,Topological Sort,Matrix | Hard | 664 |
765 | hello guys now let's try to salsa couples holding hands purpose let's see a statement uncouple sitting at ruin seats are an arranged in a row and wanted to hold hands we want to know their minimum number of swaps so that every couple is City side by side a swap consists of choosing any two people then they stand up and... | Couples Holding Hands | serialize-and-deserialize-n-ary-tree | There are `n` couples sitting in `2n` seats arranged in a row and want to hold hands.
The people and seats are represented by an integer array `row` where `row[i]` is the ID of the person sitting in the `ith` seat. The couples are numbered in order, the first couple being `(0, 1)`, the second couple being `(2, 3)`, an... | null | String,Tree,Depth-First Search,Breadth-First Search | Hard | 297,449,771 |
368 | hey hello there today we're looking at uh lead coding challenge question largest divisible subset we have a set of distinct positive integers and we want to find the largest subset such that every pair of integers within the status within this subset satisfy this condition so the condition is that we're doing modulo di... | Largest Divisible Subset | largest-divisible-subset | Given a set of **distinct** positive integers `nums`, return the largest subset `answer` such that every pair `(answer[i], answer[j])` of elements in this subset satisfies:
* `answer[i] % answer[j] == 0`, or
* `answer[j] % answer[i] == 0`
If there are multiple solutions, return any of them.
**Example 1:**
**Inp... | null | Array,Math,Dynamic Programming,Sorting | Medium | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.