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 |
|---|---|---|---|---|---|---|---|---|
118 | I have work Compact Zeta Monica Today When stored for Pascal day will germinate single and Twin birth number of errors that are you want to go Pascal tricorder Wat Temple the want to exert ourselves in garment and number Live Show me what purpose language phytic goals and this is an example of strange events And you Lo... | 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 |
312 | hey what's up guys John here so today let's talk about this like another list called problem number 312 burst balloons this is like another thing classic TP problem dynamic programming so let's take a look you're given like a array of balloons and each balloon have it has a value on it and you can burst any balloons so... | Burst Balloons | burst-balloons | You are given `n` balloons, indexed from `0` to `n - 1`. Each balloon is painted with a number on it represented by an array `nums`. You are asked to burst all the balloons.
If you burst the `ith` balloon, you will get `nums[i - 1] * nums[i] * nums[i + 1]` coins. If `i - 1` or `i + 1` goes out of bounds of the array, ... | null | Array,Dynamic Programming | Hard | 1042 |
1,318 | My Tab 20 Channel I am and today date just went to you and also equal to see that let's train to see this question on see that let's train to see this question on see that let's train to see this question on this day Kajal song and question is alliance positive numbers A B & C is alliance positive numbers A B &... | Minimum Flips to Make a OR b Equal to c | tournament-winners | Given 3 positives numbers `a`, `b` and `c`. Return the minimum flips required in some bits of `a` and `b` to make ( `a` OR `b` == `c` ). (bitwise OR operation).
Flip operation consists of change **any** single bit 1 to 0 or change the bit 0 to 1 in their binary representation.
**Example 1:**
**Input:** a = 2, b = 6... | null | Database | Hard | null |
133 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem clone graph so we're given a reference to a node that is in a connected undirected graph so it's convenient for us that the graph is completely connected and all we want to do is return a deep copy of that graph in othe... | Clone Graph | clone-graph | Given a reference of a node in a **[connected](https://en.wikipedia.org/wiki/Connectivity_(graph_theory)#Connected_graph)** undirected graph.
Return a [**deep copy**](https://en.wikipedia.org/wiki/Object_copying#Deep_copy) (clone) of the graph.
Each node in the graph contains a value (`int`) and a list (`List[Node]`)... | null | Hash Table,Depth-First Search,Breadth-First Search,Graph | Medium | 138,1624,1634 |
143 | everyone today we're going to see reorder list which is a challenge problem for today this problem is absolute pressure for linked list you know it got all the techniques for list in terms of list you can have two pointers in terms of linked list you have reversing the linked list you have middle of the linked list and... | 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 |
823 | hello everyone welcome to coderscamp and today we are going to cover another binary tree problem that is binary trees with factors so we are given an integer array and we have to written the number of binary trees we can make from the given values and the constraints given here is each non-leaf node's value should be i... | Binary Trees With Factors | split-array-with-same-average | Given an array of unique integers, `arr`, where each integer `arr[i]` is strictly greater than `1`.
We make a binary tree using these integers, and each number may be used for any number of times. Each non-leaf node's value should be equal to the product of the values of its children.
Return _the number of binary tre... | null | Array,Math,Dynamic Programming,Bit Manipulation,Bitmask | Hard | 2162 |
766 | 766 Mentos pullets matrix and I'm fired to not say that way but a matrix is tablets if every diagonal from left top left to bottom white has the same element now given M times n matrix return true if and only if the matrix is to blitz okay I mean I think that's fine do I want to use Python I guess I've been practice in... | Toeplitz Matrix | flatten-a-multilevel-doubly-linked-list | Given an `m x n` `matrix`, return _`true` if the matrix is Toeplitz. Otherwise, return `false`._
A matrix is **Toeplitz** if every diagonal from top-left to bottom-right has the same elements.
**Example 1:**
**Input:** matrix = \[\[1,2,3,4\],\[5,1,2,3\],\[9,5,1,2\]\]
**Output:** true
**Explanation:**
In the above gr... | null | Linked List,Depth-First Search,Doubly-Linked List | Medium | 114,1796 |
650 | hello everyone so in this video let us talk about a problem from lead code it's a medium level problem the problem name is two keys keep okay so the problem goes like this that there is only one character a on the screen of a notepad and you can perform two types of operation on that particular notepad so the operation... | 2 Keys Keyboard | 2-keys-keyboard | There is only one character `'A'` on the screen of a notepad. You can perform one of two operations on this notepad for each step:
* Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).
* Paste: You can paste the characters which are copied last time.
Given an integer `... | How many characters may be there in the clipboard at the last step if n = 3? n = 7? n = 10? n = 24? | Math,Dynamic Programming | Medium | 651,1033 |
319 | hello everyone welcome back to another leeco problem solving session today we're doing the problem of the day for April 27th is called bulb Switcher so 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 i... | 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 |
1,689 | Friends welcome back and speedometer into this scene if this is a problem 250 hours this alarm problem art this vinegar number we need to find the number of number subscribe number only for example 32.2 number three 500 2830 hot [praise] [praise] [praise] 12345 has a problem do it i need to have no idea of one or two... | Partitioning Into Minimum Number Of Deci-Binary Numbers | detect-pattern-of-length-m-repeated-k-or-more-times | A decimal number is called **deci-binary** if each of its digits is either `0` or `1` without any leading zeros. For example, `101` and `1100` are **deci-binary**, while `112` and `3001` are not.
Given a string `n` that represents a positive decimal integer, return _the **minimum** number of positive **deci-binary** n... | Use a three-layer loop to check all possible patterns by iterating through all possible starting positions, all indexes less than m, and if the character at the index is repeated k times. | Array,Enumeration | Easy | 1764 |
152 | Do it to Ajay, do it 200 Hey guys welcome to food of yours next question is maximum product in the morning, something like this has to be subscribed to each other so that those who talk about the product to the maximum, then in this survey - - - - To subscribe, not to subscribe to the product, if you have not subscribe... | Maximum Product Subarray | maximum-product-subarray | Given an integer array `nums`, find a subarray that has the largest product, and return _the product_.
The test cases are generated so that the answer will fit in a **32-bit** integer.
**Example 1:**
**Input:** nums = \[2,3,-2,4\]
**Output:** 6
**Explanation:** \[2,3\] has the largest product 6.
**Example 2:**
**I... | null | Array,Dynamic Programming | Medium | 53,198,238,628,713 |
229 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem majority element 2 I highly recommend you solve the first version of this problem before trying to tackle this one even though this one is slightly different and the solution definitely is a bit different but we're give... | Majority Element II | majority-element-ii | Given an integer array of size `n`, find all elements that appear more than `⌊ n/3 ⌋` times.
**Example 1:**
**Input:** nums = \[3,2,3\]
**Output:** \[3\]
**Example 2:**
**Input:** nums = \[1\]
**Output:** \[1\]
**Example 3:**
**Input:** nums = \[1,2\]
**Output:** \[1,2\]
**Constraints:**
* `1 <= nums.length <... | How many majority elements could it possibly have?
Do you have a better hint? Suggest it! | Array,Hash Table,Sorting,Counting | Medium | 169,1102 |
1,021 | what's up everyone today we're gonna go over leak code 2021 remove outer parentheses now the problem description is a little involved so I'm going to explain that first before I get into the code in the solution so if you already know what the problem is asking you can skip ahead now the input is gonna be a string like... | Remove Outermost Parentheses | distribute-coins-in-binary-tree | A valid parentheses string is either empty `" "`, `"( " + A + ") "`, or `A + B`, where `A` and `B` are valid parentheses strings, and `+` represents string concatenation.
* For example, `" "`, `"() "`, `"(())() "`, and `"(()(())) "` are all valid parentheses strings.
A valid parentheses string `s` is primitive if i... | null | Tree,Depth-First Search,Binary Tree | Medium | 863,1008 |
668 | I cook 668 a Keith smallest number in multiplication table nearly everyone has used him one occasion Tama but could you find the cave smallest number cut me from the modification table given the height M and the length and of an M times and what occasion table in a positive integer K you need to return the cave smalles... | Kth Smallest Number in Multiplication Table | kth-smallest-number-in-multiplication-table | Nearly everyone has used the [Multiplication Table](https://en.wikipedia.org/wiki/Multiplication_table). The multiplication table of size `m x n` is an integer matrix `mat` where `mat[i][j] == i * j` (**1-indexed**).
Given three integers `m`, `n`, and `k`, return _the_ `kth` _smallest element in the_ `m x n` _multipli... | null | Binary Search | Hard | 378,719,802 |
253 | hey yo what's up guys babybear4812 coming at you one more time uh today with a problem 253 the meeting rooms problem i'd like to put in a bit of a plug here maybe before i begin uh in that i made a video this earlier this week that i will link down below about how to generally solve these uh meeting room time schedule ... | Meeting Rooms II | meeting-rooms-ii | Given an array of meeting time intervals `intervals` where `intervals[i] = [starti, endi]`, return _the minimum number of conference rooms required_.
**Example 1:**
**Input:** intervals = \[\[0,30\],\[5,10\],\[15,20\]\]
**Output:** 2
**Example 2:**
**Input:** intervals = \[\[7,10\],\[2,4\]\]
**Output:** 1
**Constr... | Think about how we would approach this problem in a very simplistic way. We will allocate rooms to meetings that occur earlier in the day v/s the ones that occur later on, right? If you've figured out that we have to sort the meetings by their start time, the next thing to think about is how do we do the allocation? Th... | Array,Two Pointers,Greedy,Sorting,Heap (Priority Queue) | Medium | 56,252,452,1184 |
946 | hey everybody this is Larry this is day 13th of the Lego day challenge hit the like button hit the Subscribe button join me on Discord let me know what you think about today's problem oh yeah once in a while you see me check this page and sometimes even successfully because on the upper left side you see unbox surprise... | Validate Stack Sequences | smallest-range-ii | Given two integer arrays `pushed` and `popped` each with distinct values, return `true` _if this could have been the result of a sequence of push and pop operations on an initially empty stack, or_ `false` _otherwise._
**Example 1:**
**Input:** pushed = \[1,2,3,4,5\], popped = \[4,5,3,2,1\]
**Output:** true
**Explana... | null | Array,Math,Greedy,Sorting | Medium | null |
708 | hey guys how's everything going this is chaser who is not good at algorithms in this video I'm going to take a look at 7:08 insert into a sort of circular 7:08 insert into a sort of circular 7:08 insert into a sort of circular linked list we're given a node from a circular linked list circular okay which is sort in asc... | Insert into a Sorted Circular Linked List | insert-into-a-sorted-circular-linked-list | Given a Circular Linked List node, which is sorted in non-descending order, write a function to insert a value `insertVal` into the list such that it remains a sorted circular list. The given node can be a reference to any single node in the list and may not necessarily be the smallest value in the circular list.
If t... | null | null | Medium | null |
218 | Hello everyone welcome, my name is Himanshu and C.R.A.T of September Daily Challenge so and C.R.A.T of September Daily Challenge so and C.R.A.T of September Daily Challenge so come friend let's see today's question what is it so brother the name of today's problem is D skyline problem and R this van of it kind hai brot... | The Skyline Problem | the-skyline-problem | A city's **skyline** is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of all the buildings, return _the **skyline** formed by these buildings collectively_.
The geometric information of each building is given in the array `buil... | null | Array,Divide and Conquer,Binary Indexed Tree,Segment Tree,Line Sweep,Heap (Priority Queue),Ordered Set | Hard | 699 |
76 | hey everyone today we'll be solving lead problem number 76 minimum window substring okay so in this problem we are given two strings one string is s second string is T and we have to get some substring of s which is of minimum length that is going to contain this T that is all the elements of this T is already present ... | 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 |
122 | today we'll be solving lead code question number 122 best time to buy and sell stock to we are given an integer area of prices where prices I is the price of the stock on the I so we have to find the maximum profit we can have so as you can see in the example like 7153 64 we can see that the maximum output and the maxi... | Best Time to Buy and Sell Stock II | best-time-to-buy-and-sell-stock-ii | You are given an integer array `prices` where `prices[i]` is the price of a given stock on the `ith` day.
On each day, you may decide to buy and/or sell the stock. You can only hold **at most one** share of the stock at any time. However, you can buy it then immediately sell it on the **same day**.
Find and return _t... | null | Array,Dynamic Programming,Greedy | Medium | 121,123,188,309,714 |
438 | today we will solve lead code 438 and it says find all the anagrams in a string so let's understand the problem you are given a string and you are also given a pattern so what you have to do uh you have to find all the occurrences of the anagrams of this pattern so first let's list the anagrams it will be abc acb bac b... | 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 |
989 | in left to right order that means if they are given an integer called num as one three to one then its array form will be one commodity that is in left to right order so given this num which is in Array form and integer K we have to return the array form of integer num plus k so let's stay a number of which is in other... | 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 |
5 | in this video we'll go over lead code question number five longest palindromic substring given a string we have to return the longest substring that is also a palindrome is a sequence that reads the same backwards as it does forwards for example if our string was hello then we would return LL since LL read backwards is... | 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 |
1,773 | okay let's talk about counts item matching rule so we are given a row key and rule value so for this key is color and value is server and you are giving type color name right so you are going to find out the color blue server go around and then if the value equal to the row value and you return for this simple type rig... | Count Items Matching a Rule | percentage-of-users-attended-a-contest | You are given an array `items`, where each `items[i] = [typei, colori, namei]` describes the type, color, and name of the `ith` item. You are also given a rule represented by two strings, `ruleKey` and `ruleValue`.
The `ith` item is said to match the rule if **one** of the following is true:
* `ruleKey == "type "` ... | null | Database | Easy | 1338 |
1,313 | hey what's going on guys it's ilya bella here i recorded stuff on youtube chat description for all my information i do all legal problems make sure you um subscribe to the channel give me a big thumbs up to support it and this is called the compress run length encoded list we are given a list numbers of integers repres... | Decompress Run-Length Encoded List | count-ways-to-build-rooms-in-an-ant-colony | We are given a list `nums` of integers representing a list compressed with run-length encoding.
Consider each adjacent pair of elements `[freq, val] = [nums[2*i], nums[2*i+1]]` (with `i >= 0`). For each such pair, there are `freq` elements with value `val` concatenated in a sublist. Concatenate all the sublists from l... | Use dynamic programming. Let dp[i] be the number of ways to solve the problem for the subtree of node i. Imagine you are trying to fill an array with the order of traversal, dp[i] equals the multiplications of the number of ways to distribute the subtrees of the children of i on the array using combinatorics, multiplie... | Math,Dynamic Programming,Tree,Graph,Topological Sort,Combinatorics | Hard | null |
1,786 | hello welcome today let try to solve L code problem 178 six number of restricted parts from first to last no so let's first understand this question and then I'm going to solve it by the D TR algorithm with the yeah I'm going to use the D TR algorithm with the dynamic programming yeah because otherwise if I yeah after ... | Number of Restricted Paths From First to Last Node | count-the-number-of-consistent-strings | There is an undirected weighted connected graph. You are given a positive integer `n` which denotes that the graph has `n` nodes labeled from `1` to `n`, and an array `edges` where each `edges[i] = [ui, vi, weighti]` denotes that there is an edge between nodes `ui` and `vi` with weight equal to `weighti`.
A path from ... | A string is incorrect if it contains a character that is not allowed Constraints are small enough for brute force | Array,Hash Table,String,Bit Manipulation | Easy | null |
929 | hello welcome to my channel i'm here to do my 100 lego challenge and today we have the code 929 unique email addresses so for this question the description is really long but in summary you will receive a string array of emails in here and then each email is like a string but in that string we need to process few thing... | Unique Email Addresses | groups-of-special-equivalent-strings | Every **valid email** consists of a **local name** and a **domain name**, separated by the `'@'` sign. Besides lowercase letters, the email may contain one or more `'.'` or `'+'`.
* For example, in `"alice@leetcode.com "`, `"alice "` is the **local name**, and `"leetcode.com "` is the **domain name**.
If you add pe... | null | Array,Hash Table,String | Medium | null |
46 | hey what's up guys in this video we're going to walk through this nicole for our number 46 permutations so we are giving a real numbers of distinct integers and we need to return all the possible permutations and uh we can return the answer in any order so take a look at this example one two three and uh one permutatio... | Permutations | permutations | Given an array `nums` of distinct integers, return _all the possible permutations_. You can return the answer in **any order**.
**Example 1:**
**Input:** nums = \[1,2,3\]
**Output:** \[\[1,2,3\],\[1,3,2\],\[2,1,3\],\[2,3,1\],\[3,1,2\],\[3,2,1\]\]
**Example 2:**
**Input:** nums = \[0,1\]
**Output:** \[\[0,1\],\[1,0\... | null | Array,Backtracking | Medium | 31,47,60,77 |
1,721 | hey everyone today we are going to solve the radical questions shopping nodes in a linked list so you are given a head of any linked list and integer K return the head of a link to this after swapping the value of case node from the beginning and the case node from ending so let's see the example so you are given one t... | Swapping Nodes in a Linked List | maximum-profit-of-operating-a-centennial-wheel | You are given the `head` of a linked list, and an integer `k`.
Return _the head of the linked list after **swapping** the values of the_ `kth` _node from the beginning and the_ `kth` _node from the end (the list is **1-indexed**)._
**Example 1:**
**Input:** head = \[1,2,3,4,5\], k = 2
**Output:** \[1,4,3,2,5\]
**Ex... | Think simulation Note that the number of turns will never be more than 50 / 4 * n | Array,Simulation | Medium | null |
1,734 | That general Hello everyone my name is Anmol and today we are going to discuss and tomorrow question 170 record job notification question tomorrow that come in contact tomorrow means 250 hours ago he has a little question this which is the operation of this question 1720 record edit ok so this The question is how much ... | Decode XORed Permutation | bank-account-summary-ii | There is an integer array `perm` that is a permutation of the first `n` positive integers, where `n` is always **odd**.
It was encoded into another integer array `encoded` of length `n - 1`, such that `encoded[i] = perm[i] XOR perm[i + 1]`. For example, if `perm = [1,3,2]`, then `encoded = [2,1]`.
Given the `encoded`... | null | Database | Easy | null |
269 | hello friends today less though alien dictionary problem there is a new alien language which uses alerts he alphabet however the odor among letters are long to you receive a list of non empty words from the dictionary where words are sorted lexicographically by the rules of this new language derive the order of letters... | 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 |
14 | foreign number 14 which is longest common prefix this is 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 so we'll have an array of strings with flower flow and flight and no return flow and they went with dog race car and it retur... | 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 |
1,944 | hi friends welcome back today we are going to solve lead code problem 1944 number of visible people in a queue before we go through the description and the examples i just want to mention that my channel focuses on helping people who are preparing for coding interviews as well as java interviews uh this channel has a l... | Number of Visible People in a Queue | truncate-sentence | There are `n` people standing in a queue, and they numbered from `0` to `n - 1` in **left to right** order. You are given an array `heights` of **distinct** integers where `heights[i]` represents the height of the `ith` person.
A person can **see** another person to their right in the queue if everybody in between is ... | It's easier to solve this problem on an array of strings so parse the string to an array of words After return the first k words as a sentence | Array,String | Easy | null |
64 | hey guys uma here and welcome to another one in today's video we're going to be going through lead code problem number 64. minimum path sum let's jump into it as i've said in all of my previous videos the first step to solving any programming problem lead code or whatever is to read and understand the problem statement... | 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 |
253 | Which care for Ajay? Good morning everyone and good evening good afternoon from distance. You are watching this, okay, you will get 100 paise for a few days in this video of Kaliyuga, today we will do Ajay Kushwaha in the meeting room, we will approach him from the country for money because Meet one will be Chronicle o... | Meeting Rooms II | meeting-rooms-ii | Given an array of meeting time intervals `intervals` where `intervals[i] = [starti, endi]`, return _the minimum number of conference rooms required_.
**Example 1:**
**Input:** intervals = \[\[0,30\],\[5,10\],\[15,20\]\]
**Output:** 2
**Example 2:**
**Input:** intervals = \[\[7,10\],\[2,4\]\]
**Output:** 1
**Constr... | Think about how we would approach this problem in a very simplistic way. We will allocate rooms to meetings that occur earlier in the day v/s the ones that occur later on, right? If you've figured out that we have to sort the meetings by their start time, the next thing to think about is how do we do the allocation? Th... | Array,Two Pointers,Greedy,Sorting,Heap (Priority Queue) | Medium | 56,252,452,1184 |
1,637 | hey everybody this is larry this is me going over q2 of the recent bi-weekly contest of the recent bi-weekly contest of the recent bi-weekly contest 38 from the code uh write this vertical area between two points containing no points so this one actually it took me about two minutes to solve during the contest most of ... | 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 |
739 | So hai gas welcome tu code off so our next question is daily temperature so I was checking the daily challenge recently gas and I got a question in which the strike is very good he is getting this question from our previous question Speed is quite related. Previous, we had Speed is quite related. Previous, we had S... | 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 |
867 | That Aapke Ajay Ko Hua Hai Hello Everyone Welcome to New Video English Video By Going To Discuss Another Problem But 6 Transport Subscribe Problem Thursday Return Transport Amused and Stitching Matric passed that wars happened other if Subscribe - Verb - - Verb - - Verb - 05 - 0 And if we see till this last breath, if ... | Transpose Matrix | new-21-game | Given a 2D integer array `matrix`, return _the **transpose** of_ `matrix`.
The **transpose** of a matrix is the matrix flipped over its main diagonal, switching the matrix's row and column indices.
**Example 1:**
**Input:** matrix = \[\[1,2,3\],\[4,5,6\],\[7,8,9\]\]
**Output:** \[\[1,4,7\],\[2,5,8\],\[3,6,9\]\]
**E... | null | Math,Dynamic Programming,Sliding Window,Probability and Statistics | Medium | null |
981 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem time based key value store and this is one of my favorite problems honestly on all of late code because there's not a lot of fancy tricks involved you can really logically uh you know dig your way through this problem s... | Time Based Key-Value Store | delete-columns-to-make-sorted | Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp.
Implement the `TimeMap` class:
* `TimeMap()` Initializes the object of the data structure.
* `void set(String key, String value, int timestamp)... | null | Array,String | Easy | null |
271 | in this video we're going to take a look at a legal problem called uncode and decode strings so design an algorithm to uncode a list of strings to a string the decode string is sent over the network and is decoded back to the original list of strings so you can see here on the right we have a class of code uh right so ... | Encode and Decode Strings | encode-and-decode-strings | Design an algorithm to encode **a list of strings** to **a string**. The encoded string is then sent over the network and is decoded back to the original list of strings.
Machine 1 (sender) has the function:
string encode(vector strs) {
// ... your code
return encoded\_string;
}
Machine 2 (receiver) has the func... | null | Array,String,Design | Medium | 38,297,443,696 |
1,254 | hey everyone welcome to my channel in this video i'm going to try to solve this problem at the same time i'm going to follow the generating theory steps while trying to solve this problem so let's get started so in the real interview the first step is always to try to understand the question if there is anything unclea... | Number of Closed Islands | deepest-leaves-sum | Given a 2D `grid` consists of `0s` (land) and `1s` (water). An _island_ is a maximal 4-directionally connected group of `0s` and a _closed island_ is an island **totally** (all left, top, right, bottom) surrounded by `1s.`
Return the number of _closed islands_.
**Example 1:**
**Input:** grid = \[\[1,1,1,1,1,1,1,0\],... | Traverse the tree to find the max depth. Traverse the tree again to compute the sum required. | Tree,Depth-First Search,Breadth-First Search,Binary Tree | Medium | null |
319 | hey everybody this is Larry this is April 26th uh or 20 or day 27 I think on the legal daily challenge hit the like button hit the Subscribe button join me on Discord let me know what you think about today's problem and also there's a luck thingy click on it for 10 coins they add up I guess today's five is 319 Bob swit... | 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 |
412 | hello welcome to my channel i'm here to do my angelico challenge uh today we have leeco 412 fits bus and this is one of the easier questions um like what it's uh write a program that output a string representation of number from one to n i think you all know what's this um i'll just i won't repeat it so what's that mea... | Fizz Buzz | fizz-buzz | Given an integer `n`, return _a string array_ `answer` _(**1-indexed**) where_:
* `answer[i] == "FizzBuzz "` if `i` is divisible by `3` and `5`.
* `answer[i] == "Fizz "` if `i` is divisible by `3`.
* `answer[i] == "Buzz "` if `i` is divisible by `5`.
* `answer[i] == i` (as a string) if none of the above condit... | null | Math,String,Simulation | Easy | 1316 |
258 | hello everybody and welcome to the DC AC channel today we're going to be solving another lead cold question and just kind of preparing for technical interviews so let's pick some question remove outermost parentheses just that sounds probably too easy department table doesn't sound like something out like add digits fi... | Add Digits | add-digits | Given an integer `num`, repeatedly add all its digits until the result has only one digit, and return it.
**Example 1:**
**Input:** num = 38
**Output:** 2
**Explanation:** The process is
38 --> 3 + 8 --> 11
11 --> 1 + 1 --> 2
Since 2 has only one digit, return it.
**Example 2:**
**Input:** num = 0
**Output:** 0
*... | A naive implementation of the above process is trivial. Could you come up with other methods? What are all the possible results? How do they occur, periodically or randomly? You may find this Wikipedia article useful. | Math,Simulation,Number Theory | Easy | 202,1082,2076,2264 |
5 | Hi friends welcome back to another video and in this video we will see the longest palindrome substring so this is a medium level problem and basically we will be given a string in it so let's zoom to a string let's c a b a so this is your longest palindrome substring. If we want to find out, then first let's talk abou... | 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 |
1,970 | hello everyone welcome to quartus camp in this video we are going to cover one of the heart problem that has been asked in weekly contest of fleet code which is last day where you can still cross so the input given here is ah n cross n matrix where the row and column represent the dimensions of matrix where all the cel... | Last Day Where You Can Still Cross | sorting-the-sentence | There is a **1-based** binary matrix where `0` represents land and `1` represents water. You are given integers `row` and `col` representing the number of rows and columns in the matrix, respectively.
Initially on day `0`, the **entire** matrix is **land**. However, each day a new cell becomes flooded with **water**. ... | Divide the string into the words as an array of strings Sort the words by removing the last character from each word and sorting according to it | String,Sorting | Easy | 2168 |
948 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem bag of tokens so this is basically a little game and the rules are pretty simple so there are two concepts one is known as the score and another is known as the power initially the score is going to be zero and initiall... | Bag of Tokens | sort-an-array | You have an initial **power** of `power`, an initial **score** of `0`, and a bag of `tokens` where `tokens[i]` is the value of the `ith` token (0-indexed).
Your goal is to maximize your total **score** by potentially playing each token in one of two ways:
* If your current **power** is at least `tokens[i]`, you may... | null | Array,Divide and Conquer,Sorting,Heap (Priority Queue),Merge Sort,Bucket Sort,Radix Sort,Counting Sort | Medium | null |
1,059 | hey what is up guys for this video i'm going to be solving the code 1059 all paths from source lead to destination and essentially for this question we're given a graph with directed edges and we're given a node which is designated as the source and one node that's designated as the destination and we want to figure ou... | All Paths from Source Lead to Destination | missing-element-in-sorted-array | Given the `edges` of a directed graph where `edges[i] = [ai, bi]` indicates there is an edge between nodes `ai` and `bi`, and two nodes `source` and `destination` of this graph, determine whether or not all paths starting from `source` eventually, end at `destination`, that is:
* At least one path exists from the `s... | First define a function f(x) that counts the number of missing elements until x. Then use binary search with the given function f(x) to find the kth missing element. | Array,Binary Search | Medium | null |
942 | all right think we're hey what's up guys Nick white here just I do tech encoding stuff on twitch and YouTube if you wanna check the description I have everything I'm doing another leak code video I have all these recode videos I'm doing series on videos we're doing the easy one right now this one's called di or ya di s... | DI String Match | super-palindromes | A permutation `perm` of `n + 1` integers of all the integers in the range `[0, n]` can be represented as a string `s` of length `n` where:
* `s[i] == 'I'` if `perm[i] < perm[i + 1]`, and
* `s[i] == 'D'` if `perm[i] > perm[i + 1]`.
Given a string `s`, reconstruct the permutation `perm` and return it. If there are ... | null | Math,Enumeration | Hard | null |
356 | hello everyone let's look at lead code question 356 line reflection so in this question we're given end points on a two-dimensional plane and we need to two-dimensional plane and we need to two-dimensional plane and we need to find if there is such a line parallel to the y- axis that reflects the given the y- axis that... | Line Reflection | line-reflection | Given `n` points on a 2D plane, find if there is such a line parallel to the y-axis that reflects the given points symmetrically.
In other words, answer whether or not if there exists a line that after reflecting all points over the given line, the original points' set is the same as the reflected ones.
**Note** that... | Find the smallest and largest x-value for all points. If there is a line then it should be at y = (minX + maxX) / 2. For each point, make sure that it has a reflected point in the opposite side. | Array,Hash Table,Math | Medium | 149,447 |
67 | in this video we'll be going over add binary so given two binary strings a and b return their sum as a binary string so in our first example our a is one and b is equal to one so our and then the sum of the bits is gonna be one zero so let's first go over the dot process we will need to add the bits from right to left ... | Add Binary | add-binary | Given two binary strings `a` and `b`, return _their sum as a binary string_.
**Example 1:**
**Input:** a = "11", b = "1"
**Output:** "100"
**Example 2:**
**Input:** a = "1010", b = "1011"
**Output:** "10101"
**Constraints:**
* `1 <= a.length, b.length <= 104`
* `a` and `b` consist only of `'0'` or `'1'` chara... | null | Math,String,Bit Manipulation,Simulation | Easy | 2,43,66,1031 |
345 | 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 reverse veral of a string so this question is similar to a question called reverse words so in that question you reverse all the characters in that string in this question only have to reverse the vbls ... | Reverse Vowels of a String | reverse-vowels-of-a-string | Given a string `s`, reverse only all the vowels in the string and return it.
The vowels are `'a'`, `'e'`, `'i'`, `'o'`, and `'u'`, and they can appear in both lower and upper cases, more than once.
**Example 1:**
**Input:** s = "hello"
**Output:** "holle"
**Example 2:**
**Input:** s = "leetcode"
**Output:** "leotc... | null | Two Pointers,String | Easy | 344,1089 |
74 | Hello Hi Everyone, This Time Had Solved Problems In To-Do List To Play List Problems In To-Do List To Play List Problems In To-Do List To Play List Problem Please Give Every Spirit The Last Five Strict Sure Properties Also Apni Total Roop Africa Garhwali 110 And Neetu Se Possible Price Adhesion Problem In Such A Condit... | Search a 2D Matrix | search-a-2d-matrix | You are given an `m x n` integer matrix `matrix` with the following two properties:
* Each row is sorted in non-decreasing order.
* The first integer of each row is greater than the last integer of the previous row.
Given an integer `target`, return `true` _if_ `target` _is in_ `matrix` _or_ `false` _otherwise_.
... | null | Array,Binary Search,Matrix | Medium | 240 |
236 | So same gas, new day and new question, today we have question number 54 because our day 54 is the lowest common and sister of a binary tree, so yesterday we had seen the binary search tree, so I would request you first of all to see BST once. What is luck, okay you will understand it well, it was an easy question, if y... | 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 |
70 | hey hello there let's talk about today's lit coding challenge question climbing stairs it's a really classic problem and many people including me the introduction problem to dynamic programming so uh i think if you have cs background you probably already know how to solve this so i'm gonna be really brief on the explan... | Climbing Stairs | climbing-stairs | You are climbing a staircase. It takes `n` steps to reach the top.
Each time you can either climb `1` or `2` steps. In how many distinct ways can you climb to the top?
**Example 1:**
**Input:** n = 2
**Output:** 2
**Explanation:** There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
**Example 2:**
... | To reach nth step, what could have been your previous steps? (Think about the step sizes) | Math,Dynamic Programming,Memoization | Easy | 747,1013,1236 |
678 | okay that's off today silicon enchanted question validated professor string we have an impostor in with three type of characters open and closing purposes as well as asterisks we need to write a function to check the validity of the strings by their following rules a the first three things just telling us that we have ... | Valid Parenthesis String | valid-parenthesis-string | Given a string `s` containing only three types of characters: `'('`, `')'` and `'*'`, return `true` _if_ `s` _is **valid**_.
The following rules define a **valid** string:
* Any left parenthesis `'('` must have a corresponding right parenthesis `')'`.
* Any right parenthesis `')'` must have a corresponding left p... | null | String,Dynamic Programming,Stack,Greedy | Medium | 763,2221 |
454 | welcome guys so uh welcome to my lego section so in this video we try to solve basically is this for some number two so give you a b c d and uh you need to calculate how many tuples uh in a and b and c and d sum is zero sum zero okay so for example uh this one you have you will have two then just take a zero and one el... | 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 |
33 | welcome to lee coats blind created 75 where i'll be solving the top 75 lead code questions this problems search in rotated sorted array suppose an array sorted in ascending order is rotated at some pivot point say we're given a list like this zero one two four five six seven and it can be rotated in this format four fi... | 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 |
226 | hello hi everyone welcome back to the channel so this is your randip Singh I'm back with yet another lead code problem after so long pause because I was busy in some interviews and in some not so important work but we'll be consistent from this video onwards so let's read the problem statement the problem name is inver... | Invert Binary Tree | invert-binary-tree | Given the `root` of a binary tree, invert the tree, and return _its root_.
**Example 1:**
**Input:** root = \[4,2,7,1,3,6,9\]
**Output:** \[4,7,2,9,6,3,1\]
**Example 2:**
**Input:** root = \[2,1,3\]
**Output:** \[2,3,1\]
**Example 3:**
**Input:** root = \[\]
**Output:** \[\]
**Constraints:**
* The number of n... | null | Tree,Depth-First Search,Breadth-First Search,Binary Tree | Easy | null |
877 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem stone game and honestly this is a very interesting problem in fact it's so interesting that there's around 10 problems 10 variations of the stone game problem on leak code and believe it or not we can skip directly to t... | Stone Game | shortest-path-visiting-all-nodes | Alice and Bob play a game with piles of stones. There are an **even** number of piles arranged in a row, and each pile has a **positive** integer number of stones `piles[i]`.
The objective of the game is to end with the most stones. The **total** number of stones across all the piles is **odd**, so there are no ties.
... | null | Dynamic Programming,Bit Manipulation,Breadth-First Search,Graph,Bitmask | Hard | null |
1,499 | q for max valuable equation so this became a mano q max Q algorithm I have a link below to my explanation of how to sell my new cube bombs but the tricky part and it is not easy is recognizing that so one is that the X are sorted so I actually try to sort first but it's not necessary because it's already sorted but you... | Max Value of Equation | maximum-performance-of-a-team | You are given an array `points` containing the coordinates of points on a 2D plane, sorted by the x-values, where `points[i] = [xi, yi]` such that `xi < xj` for all `1 <= i < j <= points.length`. You are also given an integer `k`.
Return _the maximum value of the equation_ `yi + yj + |xi - xj|` where `|xi - xj| <= k` ... | Keep track of the engineers by their efficiency in decreasing order. Starting from one engineer, to build a team, it suffices to bring K-1 more engineers who have higher efficiencies as well as high speeds. | Array,Greedy,Sorting,Heap (Priority Queue) | Hard | 2229 |
1,302 | hey everybody this is larry this is day 15 i think of the may like day challenge hit the like button hit the subscriber enjoyment discord let me know what you think i still have crazy allergies so oh man it's so hard to talk so give me some love and support oh i need to take more whatever it is and the contest is comin... | Deepest Leaves Sum | delete-characters-to-make-fancy-string | Given the `root` of a binary tree, return _the sum of values of its deepest leaves_.
**Example 1:**
**Input:** root = \[1,2,3,4,5,null,6,7,null,null,null,null,8\]
**Output:** 15
**Example 2:**
**Input:** root = \[6,7,8,2,7,1,3,9,null,1,4,null,null,null,5\]
**Output:** 19
**Constraints:**
* The number of nodes i... | What's the optimal way to delete characters if three or more consecutive characters are equal? If three or more consecutive characters are equal, keep two of them and delete the rest. | String | Easy | null |
399 | Jhal Ajay Ko Hello Friends Welcome to my YouTube channel Today they are going from Solid Problem to 1000 Problem Yes-Yes Railway Division The 1000 Problem Yes-Yes Railway Division The 1000 Problem Yes-Yes Railway Division The Problem of Medium Category Lahari Doctors Statement Your Given Address of Variable Pairs Equat... | Evaluate Division | evaluate-division | You are given an array of variable pairs `equations` and an array of real numbers `values`, where `equations[i] = [Ai, Bi]` and `values[i]` represent the equation `Ai / Bi = values[i]`. Each `Ai` or `Bi` is a string that represents a single variable.
You are also given some `queries`, where `queries[j] = [Cj, Dj]` rep... | Do you recognize this as a graph problem? | Array,Depth-First Search,Breadth-First Search,Union Find,Graph,Shortest Path | Medium | null |
48 | Hello Hi Everyone Arts Private Or Suggest Or Don't Specific Problems Candidate To Update Your Data Matrix Is Abodh A Few Loving 10 Minute Series Please Make Sure You Have The Like Button And Subscribe To Effective Youtube Channel Problem Basically Straight From Throw Tourism And Tricks Latest Tips and tricks directly f... | 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 |
98 | all right we are still doing the top line 75 leak code questions and we are on the tree section so now we're doing number 98 validate binary search tree given the root of a binary tree determinative is a valid binary search tree so as long as you're familiar with the data structure for binary search tree um this should... | Validate Binary Search Tree | validate-binary-search-tree | Given the `root` of a binary tree, _determine if it is a valid binary search tree (BST)_.
A **valid BST** is defined as follows:
* The left subtree of a node contains only nodes with keys **less than** the node's key.
* The right subtree of a node contains only nodes with keys **greater than** the node's key.
* ... | null | Tree,Depth-First Search,Binary Search Tree,Binary Tree | Medium | 94,501 |
189 | Hello Guys Myself Amrita Welcome Back To Our Channel Technosis So This Is Read This Top 150 Interview Questions Series In Which They Have Already Solved Few Problems So Today Bill Will Be Moving On To The Next Problem Date Is Rote Are So Late Get Started So This Is A Problem number one 189 which has a medium complexity... | Rotate Array | rotate-array | Given an integer array `nums`, rotate the array to the right by `k` steps, where `k` is non-negative.
**Example 1:**
**Input:** nums = \[1,2,3,4,5,6,7\], k = 3
**Output:** \[5,6,7,1,2,3,4\]
**Explanation:**
rotate 1 steps to the right: \[7,1,2,3,4,5,6\]
rotate 2 steps to the right: \[6,7,1,2,3,4,5\]
rotate 3 steps to... | The easiest solution would use additional memory and that is perfectly fine. The actual trick comes when trying to solve this problem without using any additional memory. This means you need to use the original array somehow to move the elements around. Now, we can place each element in its original location and shift ... | Array,Math,Two Pointers | Medium | 61,186 |
273 | hey guys how are you doing this is Jay sir who is not good our algorithm today let's continue our journey to needs code let's take a look at two seven three integer two in English words we need to convert a non-negative integer okay it's convert a non-negative integer okay it's convert a non-negative integer okay it's ... | Integer to English Words | integer-to-english-words | Convert a non-negative integer `num` to its English words representation.
**Example 1:**
**Input:** num = 123
**Output:** "One Hundred Twenty Three "
**Example 2:**
**Input:** num = 12345
**Output:** "Twelve Thousand Three Hundred Forty Five "
**Example 3:**
**Input:** num = 1234567
**Output:** "One Million Tw... | Did you see a pattern in dividing the number into chunk of words? For example, 123 and 123000. Group the number by thousands (3 digits). You can write a helper function that takes a number less than 1000 and convert just that chunk to words. There are many edge cases. What are some good test cases? Does your code work ... | Math,String,Recursion | Hard | 12 |
462 | hey everybody this is larry this is the last day yes it is june 30th the last day of the june nico day challenge hit the like button hit the subscribe button join me in discord let me know what you think and hope y'all if y'all here hope you're here for the full 30 days if not i mean you could look at my playlist or so... | Minimum Moves to Equal Array Elements II | minimum-moves-to-equal-array-elements-ii | Given an integer array `nums` of size `n`, return _the minimum number of moves required to make all array elements equal_.
In one move, you can increment or decrement an element of the array by `1`.
Test cases are designed so that the answer will fit in a **32-bit** integer.
**Example 1:**
**Input:** nums = \[1,2,3... | null | Array,Math,Sorting | Medium | 296,453,2160,2290 |
1,015 | hi today i'm talking about leap code problem one zero one five smallest integer divisible by k what this problem asks you to do is write a function that takes an integer k and returns the smallest in that is evenly divisible by k where n is entirely composed of the digit one and if there's no such n you're supposed to ... | Smallest Integer Divisible by K | smallest-integer-divisible-by-k | Given a positive integer `k`, you need to find the **length** of the **smallest** positive integer `n` such that `n` is divisible by `k`, and `n` only contains the digit `1`.
Return _the **length** of_ `n`. If there is no such `n`, return -1.
**Note:** `n` may not fit in a 64-bit signed integer.
**Example 1:**
**In... | null | null | Medium | null |
228 | K ribbon I have given this Adarsh Mishra and you K ribbon I have given this Adarsh Mishra and you K ribbon I have given this Adarsh Mishra and you this mission code and today we are going to talk then on the list about the summary ranges from this product there is a very lovely problem so understands and what is ... | 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 |
283 | given here a rain dance write a function to move all of its zeros towards the end of the array while maintaining the relative order of the nonzero elements how will you do that's about today's video let's get into it Row 1 this is Steve today let's go through a legal problem 283 moves zeroes take a look at the problem ... | 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 |
34 | welcome to this lecture where we will solve the first and last index problem we are given a sorted array of integers R and an integer Target and we are asked to find the index of the first and last position of targeting r if Target can be found in R we turn -1 if Target can be found in R we turn -1 if Target can be fou... | Find First and Last Position of Element in Sorted Array | find-first-and-last-position-of-element-in-sorted-array | Given an array of integers `nums` sorted in non-decreasing order, find the starting and ending position of a given `target` value.
If `target` is not found in the array, return `[-1, -1]`.
You must write an algorithm with `O(log n)` runtime complexity.
**Example 1:**
**Input:** nums = \[5,7,7,8,8,10\], target = 8
*... | null | Array,Binary Search | Medium | 278,2165,2210 |
246 | hi quotas i am sanjay and in this video we will discuss lead code problem 246 a stable grammatic number so let's see what the descriptions is given a string num which represents an integer return true if num is a stable grammatic number is a number that looks the same when rotated 180 degrees looked at upside down so l... | Strobogrammatic Number | strobogrammatic-number | Given a string `num` which represents an integer, return `true` _if_ `num` _is a **strobogrammatic number**_.
A **strobogrammatic number** is a number that looks the same when rotated `180` degrees (looked at upside down).
**Example 1:**
**Input:** num = "69 "
**Output:** true
**Example 2:**
**Input:** num = "88... | null | Hash Table,Two Pointers,String | Easy | 247,248,1069 |
270 | hi so this is problem number 270 on lead code closest binary search tree value given the root of a binary search tree and a target value return the value of the bst that is closest to the target so what we will do is since it is binary search tree we will have to traverse it in one of the uh we have to traverse it and ... | Closest Binary Search Tree Value | closest-binary-search-tree-value | Given the `root` of a binary search tree and a `target` value, return _the value in the BST that is closest to the_ `target`. If there are multiple answers, print the smallest.
**Example 1:**
**Input:** root = \[4,2,5,1,3\], target = 3.714286
**Output:** 4
**Example 2:**
**Input:** root = \[1\], target = 4.428571
*... | null | Binary Search,Tree,Depth-First Search,Binary Search Tree,Binary Tree | Easy | 222,272,783 |
171 | hello everyone welcome to quartus camp we are 22nd day of february leeco challenge and the problem we are going to cover in this video is excel sheet column number so the input given here is a string with alphabets and we have to return the corresponding column number for the given column title so let's understand this... | Excel Sheet Column Number | excel-sheet-column-number | Given a string `columnTitle` that represents the column title as appears in an Excel sheet, return _its corresponding column number_.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...
**Example 1:**
**Input:** columnTitle = "A "
**Output:** 1
**Example 2:**
**Input:** columnTitle = "AB "
**Ou... | null | Math,String | Easy | 168,2304 |
894 | Hello gas welcome you me youtube channel so today we are going to solve today report problem 894 which is possible flower binary tree so what is this question about we have been given n wait and we sir have to return as many flowers as possible So see like the value of N is 7 then it said to return like this is a flowe... | All Possible Full Binary Trees | random-pick-with-blacklist | Given an integer `n`, return _a list of all possible **full binary trees** with_ `n` _nodes_. Each node of each tree in the answer must have `Node.val == 0`.
Each element of the answer is the root node of one possible tree. You may return the final list of trees in **any order**.
A **full binary tree** is a binary tr... | null | Hash Table,Math,Binary Search,Sorting,Randomized | Hard | 398,912,2107 |
703 | Hello Everyone Welcome Back to My Channel Today Were Going to Discuss the Problem Share Please Element Industry Switch Very Easy Problem Receiver Problems Designer Class to Front District Judge Element Interesting Key Notifications Rajesh Element in Short and Not as Distinct Element Key Implement Care sa just class sle... | Kth Largest Element in a Stream | kth-largest-element-in-a-stream | Design a class to find the `kth` largest element in a stream. Note that it is the `kth` largest element in the sorted order, not the `kth` distinct element.
Implement `KthLargest` class:
* `KthLargest(int k, int[] nums)` Initializes the object with the integer `k` and the stream of integers `nums`.
* `int add(int... | null | null | Easy | null |
926 | Hello gas welcome back to my channel thank you and today's need for challenge Philip string so make a monotonic increasing string ok so in this question basically I have given a binary swing which has zero and one and what you have to do is you flip the zero. You can do this and flip the vane to zero and what you have ... | Flip String to Monotone Increasing | find-and-replace-pattern | A binary string is monotone increasing if it consists of some number of `0`'s (possibly none), followed by some number of `1`'s (also possibly none).
You are given a binary string `s`. You can flip `s[i]` changing it from `0` to `1` or from `1` to `0`.
Return _the minimum number of flips to make_ `s` _monotone increa... | null | Array,Hash Table,String | Medium | null |
2 | hey guys i'm still unemployed so let's solve another leak code problem today leak code 2 add two numbers together so just like the problem says all we're really doing is adding two numbers together right so like this example 342 465 add them together right that's 807. well you probably remember from elementary school h... | 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 |
115 | hey what's up guys this is chung here again so this time lead code number 115 distinct subsequences okay so now this time we have two strings right s and t and we need to find how many distinct subsequences of s which equals to t right so basically for example we have this rabbit and it's a rabbit and this rabbit so th... | Distinct Subsequences | distinct-subsequences | Given two strings `s` and `t`, return _the number of distinct_ **_subsequences_** _of_ `s` _which equals_ `t`.
The test cases are generated so that the answer fits on a 32-bit signed integer.
**Example 1:**
**Input:** s = "rabbbit ", t = "rabbit "
**Output:** 3
**Explanation:**
As shown below, there are 3 ways you... | null | String,Dynamic Programming | Hard | 2115 |
1,707 | hey everybody this is larry this is q4 of the weekly contest 221 maximum xor with an element from away so this was um a problem during the contest that i to be honest i feel like i've solved this before a similar version but i couldn't really figure out from where uh and to be honest i actually solved this in about 15 ... | Maximum XOR With an Element From Array | check-if-string-is-transformable-with-substring-sort-operations | You are given an array `nums` consisting of non-negative integers. You are also given a `queries` array, where `queries[i] = [xi, mi]`.
The answer to the `ith` query is the maximum bitwise `XOR` value of `xi` and any element of `nums` that does not exceed `mi`. In other words, the answer is `max(nums[j] XOR xi)` for a... | Suppose the first digit you need is 'd'. How can you determine if it's possible to get that digit there? Consider swapping adjacent characters to maintain relative ordering. | String,Greedy,Sorting | Hard | null |
34 | hello everyone let's look at five first and last position of element in sorted array the problem statement is we are giving an array of integers norms sorted in ascending order we want to find the starting and ending position of a given target value if not found simply return negative one when follow-up challenges can ... | Find First and Last Position of Element in Sorted Array | find-first-and-last-position-of-element-in-sorted-array | Given an array of integers `nums` sorted in non-decreasing order, find the starting and ending position of a given `target` value.
If `target` is not found in the array, return `[-1, -1]`.
You must write an algorithm with `O(log n)` runtime complexity.
**Example 1:**
**Input:** nums = \[5,7,7,8,8,10\], target = 8
*... | null | Array,Binary Search | Medium | 278,2165,2210 |
140 | take a look at a legal problem called word break number two so given a string s and a dictionary of strings word dict um add spaces in s to construct a sentence where each word is a valid dictionary word return all such possible sentences in any order so note that the same word in the dictionary might be reused multipl... | Word Break II | word-break-ii | Given a string `s` and a dictionary of strings `wordDict`, add spaces in `s` to construct a sentence where each word is a valid dictionary word. Return all such possible sentences in **any order**.
**Note** that the same word in the dictionary may be reused multiple times in the segmentation.
**Example 1:**
**Input:... | null | Hash Table,String,Dynamic Programming,Backtracking,Trie,Memoization | Hard | 139,472 |
318 | hi everyone so today we are here with the new lead code problem and that problem name is maximum product of word lines so in this problem we have an array which is a words array and this array contains strings let's suppose a b c d e f g a let me add more abd right so what we do we basically consider two word two strin... | 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 |
70 | hey yo what's up my little coders let me show you in this tutorial how to solve the lethal question number 70 climbing stairs basically you're climbing a staircase and it takes n steps to reach the top each time you can either climb one or two steps in how many distinct ways can you climb to the top here some examples ... | Climbing Stairs | climbing-stairs | You are climbing a staircase. It takes `n` steps to reach the top.
Each time you can either climb `1` or `2` steps. In how many distinct ways can you climb to the top?
**Example 1:**
**Input:** n = 2
**Output:** 2
**Explanation:** There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
**Example 2:**
... | To reach nth step, what could have been your previous steps? (Think about the step sizes) | Math,Dynamic Programming,Memoization | Easy | 747,1013,1236 |
1,209 | hey everyone welcome back and let's write some more neat code today so today let's solve the problem remove all adjacent duplicates in string we're given a string s and we're also given an integer k and we want to make a k duplicate removal on the string s as many times as we can basically until we can't do it anymore ... | Remove All Adjacent Duplicates in String II | design-bounded-blocking-queue | You are given a string `s` and an integer `k`, a `k` **duplicate removal** consists of choosing `k` adjacent and equal letters from `s` and removing them, causing the left and the right side of the deleted substring to concatenate together.
We repeatedly make `k` **duplicate removals** on `s` until we no longer can.
... | null | Concurrency | Medium | null |
33 | Hello guys welcome back to back door and this video will see the sachin rotated software problem which is from list to dean of the series coding challenge so let's look at the problem statement problem ever originally posted in this has been rooted in the element of this you Need To Find The Length Of The Element Other... | 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 |
1,011 | hello everyone welcome to coderscam and today we are going to start a series of videos that solves medium to hard problems from lead code using binary search and we have came across a lot of problems that deals with finally search solutions but and first go we cannot figure out it is using binary search so i'm gonna di... | Capacity To Ship Packages Within D Days | flip-binary-tree-to-match-preorder-traversal | A conveyor belt has packages that must be shipped from one port to another within `days` days.
The `ith` package on the conveyor belt has a weight of `weights[i]`. Each day, we load the ship with packages on the conveyor belt (in the order given by `weights`). We may not load more weight than the maximum weight capaci... | null | Tree,Depth-First Search,Binary Tree | Medium | null |
807 | cool so hey everyone back again to make the second video the secondly code solution or secondly code problem I wanted to first make my first video get some feedback see if it would be useful to anyone and from there like see if I want to continue making them so I got quite look good quite a good amount of feedback sayi... | 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 |
399 | hey so welcome back and this is another daily code problem so today it's called evaluate Division and it's a medium level graph problem using that first search and so I'll just go ahead and hide this for now but basically you're getting a lot of different input variables and it can be really confusing just looking at t... | Evaluate Division | evaluate-division | You are given an array of variable pairs `equations` and an array of real numbers `values`, where `equations[i] = [Ai, Bi]` and `values[i]` represent the equation `Ai / Bi = values[i]`. Each `Ai` or `Bi` is a string that represents a single variable.
You are also given some `queries`, where `queries[j] = [Cj, Dj]` rep... | Do you recognize this as a graph problem? | Array,Depth-First Search,Breadth-First Search,Union Find,Graph,Shortest Path | Medium | null |
226 | to solve the problem in what binary three so you are given the root of binary three in both the three and the returns root so let's see the example so root node is 4 and the root node has 2 children like 2 and 7 here and after inverted so we swapped so 7 should be a left side and 2 should be our right side and again so... | Invert Binary Tree | invert-binary-tree | Given the `root` of a binary tree, invert the tree, and return _its root_.
**Example 1:**
**Input:** root = \[4,2,7,1,3,6,9\]
**Output:** \[4,7,2,9,6,3,1\]
**Example 2:**
**Input:** root = \[2,1,3\]
**Output:** \[2,3,1\]
**Example 3:**
**Input:** root = \[\]
**Output:** \[\]
**Constraints:**
* The number of n... | null | Tree,Depth-First Search,Breadth-First Search,Binary Tree | Easy | null |
824 | this problem is called note latin and here you will be given one english sentence and you have to convert to this fixes language called goat latin and there are some rules by which we have to make the conversion so let's look at an example so this is the input it's an english sentence and it consists of just lowercase ... | Goat Latin | number-of-lines-to-write-string | You are given a string `sentence` that consist of words separated by spaces. Each word consists of lowercase and uppercase letters only.
We would like to convert the sentence to "Goat Latin " (a made-up language similar to Pig Latin.) The rules of Goat Latin are as follows:
* If a word begins with a vowel (`'a'`, `... | null | Array,String | Easy | null |
334 | Hello, how are you guys? Welcome to week one of the Weekly Lead Code Challenge of L. I hope you have registered for it on L's website. If you have not done so yet, then quickly track your progress. This will help us in doing so let's move towards the solution. Yes, so let's start with our A question. Ch is increasing t... | Increasing Triplet Subsequence | increasing-triplet-subsequence | Given an integer array `nums`, return `true` _if there exists a triple of indices_ `(i, j, k)` _such that_ `i < j < k` _and_ `nums[i] < nums[j] < nums[k]`. If no such indices exists, return `false`.
**Example 1:**
**Input:** nums = \[1,2,3,4,5\]
**Output:** true
**Explanation:** Any triplet where i < j < k is valid.
... | null | Array,Greedy | Medium | 300,2122,2280 |
1,013 | hey how dare so today I'm talking about questioning a thousand inserting partitioned array into three parts with equal sum we have an integer array and we want to determine if we can partition the array into three non-empty parts the array into three non-empty parts the array into three non-empty parts with equal songs... | Partition Array Into Three Parts With Equal Sum | fibonacci-number | Given an array of integers `arr`, return `true` if we can partition the array into three **non-empty** parts with equal sums.
Formally, we can partition the array if we can find indexes `i + 1 < j` with `(arr[0] + arr[1] + ... + arr[i] == arr[i + 1] + arr[i + 2] + ... + arr[j - 1] == arr[j] + arr[j + 1] + ... + arr[ar... | null | Math,Dynamic Programming,Recursion,Memoization | Easy | 70,872,905,1236 |
931 | hello hi guys good morning welcome back to a new video this has been asked by Amazon Google Bloomberg visa and Goodman Sachs in the last one to 2 years that's not frequent but yeah that's a good question it says that minimum falling path sum we are given n cross n array of integers called as Matrix now we have to retur... | Minimum Falling Path Sum | maximum-frequency-stack | Given an `n x n` array of integers `matrix`, return _the **minimum sum** of any **falling path** through_ `matrix`.
A **falling path** starts at any element in the first row and chooses the element in the next row that is either directly below or diagonally left/right. Specifically, the next element from position `(ro... | null | Hash Table,Stack,Design,Ordered Set | Hard | null |
350 | all right so this is intersection of two arrays two in javascript they're asking given two arrays find write a function that pulls out all the common numbers that are in the first array and the second array so the common numbers between array one and array two here are the twos here the common numbers in this array bet... | Intersection of Two Arrays II | intersection-of-two-arrays-ii | Given two integer arrays `nums1` and `nums2`, return _an array of their intersection_. Each element in the result must appear as many times as it shows in both arrays and you may return the result in **any order**.
**Example 1:**
**Input:** nums1 = \[1,2,2,1\], nums2 = \[2,2\]
**Output:** \[2,2\]
**Example 2:**
**I... | null | Array,Hash Table,Two Pointers,Binary Search,Sorting | Easy | 349,1044,1392,2282 |
535 | hey everyone today i'll be doing problem number 535 on leak code and decode tinyurl so the description might be confusing for some people but basically too tinyurl is some service where if we go over here you'll get like um some url that's like and then some gibberish and then some gibberish and then some gibberish and... | 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 |
554 | Hello guys welcome to agar problem the series according to devi sharda problems call break and sudhir and fennel tree subscribe and vertical lines from top to bottom important subscribe to subscribe the 1234 you to you think of this particular example2 275 for all You have one to three little difficult example You have... | 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 |
864 | all right this is like my fifth time re-recording this re-recording this re-recording this is not as easy as it seems man all right i gotta make sure i have what i wanna say you know on the tip of my tongue all right so let's look at lead code 864 shortest path to get all keys so i'm not going to actually walk through ... | Shortest Path to Get All Keys | image-overlap | You are given an `m x n` grid `grid` where:
* `'.'` is an empty cell.
* `'#'` is a wall.
* `'@'` is the starting point.
* Lowercase letters represent keys.
* Uppercase letters represent locks.
You start at the starting point and one move consists of walking one space in one of the four cardinal directions. ... | null | Array,Matrix | Medium | null |
1,217 | hello guys welcome to algorithms made easy today we will be discussing the question minimum cost to move chips to the same position in this question we are given n chips with the position of ith chip as position of i now we need to move all the chips to the same position and in one step we can change the position of th... | Minimum Cost to Move Chips to The Same Position | relative-sort-array | We have `n` chips, where the position of the `ith` chip is `position[i]`.
We need to move all the chips to **the same position**. In one step, we can change the position of the `ith` chip from `position[i]` to:
* `position[i] + 2` or `position[i] - 2` with `cost = 0`.
* `position[i] + 1` or `position[i] - 1` with... | Using a hashmap, we can map the values of arr2 to their position in arr2. After, we can use a custom sorting function. | Array,Hash Table,Sorting,Counting Sort | Easy | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.