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
1,672
Hello Everyone Welcome and Welcome Back to My Channel Suggestion or Going to Discuss the Problem 15.25 Lite Video Please Like Problem 15.25 Lite Video Please Like Problem 15.25 Lite Video Please Like and Subscribe My Channel Thank You Get Notified When Most Innovative Swift Dedicated Problem is Research Customer Wealth...
Richest Customer Wealth
find-the-index-of-the-large-integer
You are given an `m x n` integer grid `accounts` where `accounts[i][j]` is the amount of money the `i​​​​​​​​​​​th​​​​` customer has in the `j​​​​​​​​​​​th`​​​​ bank. Return _the **wealth** that the richest customer has._ A customer's **wealth** is the amount of money they have in all their bank accounts. The richest ...
Do a binary search over the array, exclude the half of the array that doesn't contain the largest number. Keep shrinking the search space till it reaches the size of 2 where you can easily determine which one has the largest integer.
Array,Binary Search,Interactive
Medium
786
107
Ko Camera Badi Today They Are Going To Discuss Level Model Transfer Suggestion Thursday That Anirudh Next Level Badji Soft Shiny E F Will Find Love Letter Will Be Amazed To See If Implemented On A [ __ ] Sports Special Guest Is The Freedom [ __ ] Sports Special Guest Is The Freedom [ __ ] Sports Special Guest Is The Fr...
Binary Tree Level Order Traversal II
binary-tree-level-order-traversal-ii
Given the `root` of a binary tree, return _the bottom-up level order traversal of its nodes' values_. (i.e., from left to right, level by level from leaf to root). **Example 1:** **Input:** root = \[3,9,20,null,null,15,7\] **Output:** \[\[15,7\],\[9,20\],\[3\]\] **Example 2:** **Input:** root = \[1\] **Output:** \[...
null
Tree,Breadth-First Search,Binary Tree
Medium
102,637
1,024
hey what's up guys this is chung here again so today let's take a look at 1024 video stitching okay so you're giving like a series of video clips from a sporting event blah that lasted 2 seconds and these video clips can be overlapping with each other and have varied length and every video clips is interval okay and it...
Video Stitching
triples-with-bitwise-and-equal-to-zero
You are given a series of video clips from a sporting event that lasted `time` seconds. These video clips can be overlapping with each other and have varying lengths. Each video clip is described by an array `clips` where `clips[i] = [starti, endi]` indicates that the ith clip started at `starti` and ended at `endi`. ...
null
Array,Hash Table,Bit Manipulation
Hard
null
132
Hello Everyone Welcome to Day 725 Original Some 4 Injured S Questions Silent Room A Partitioning Two Then Already Sold Tonic Partition in December 2004 Don't See the Video Age Electronics Questions in This Question Give Winners Rings End Partition Tab Screen Office Partition Before Rule Me To The Number Of From Obscuri...
Palindrome Partitioning II
palindrome-partitioning-ii
Given a string `s`, partition `s` such that every substring of the partition is a palindrome. Return _the **minimum** cuts needed for a palindrome partitioning of_ `s`. **Example 1:** **Input:** s = "aab " **Output:** 1 **Explanation:** The palindrome partitioning \[ "aa ", "b "\] could be produced using 1 cut. **...
null
String,Dynamic Programming
Hard
131,1871
962
Hey gas ho are you all you are doing good welcome tu de lord so today c will solve de van more question in our ise level in our stack cities and if you have not have access de stack analysis it so we are in our medium level so In this we are given that we have a name in which give us I less which will be and the value ...
Maximum Width Ramp
flip-string-to-monotone-increasing
A **ramp** in an integer array `nums` is a pair `(i, j)` for which `i < j` and `nums[i] <= nums[j]`. The **width** of such a ramp is `j - i`. Given an integer array `nums`, return _the maximum width of a **ramp** in_ `nums`. If there is no **ramp** in `nums`, return `0`. **Example 1:** **Input:** nums = \[6,0,8,2,1,...
null
String,Dynamic Programming
Medium
null
438
hi guys welcome to beginner check is in this video I am going to discuss about uh find all anagrams problem right as I'm discussing about a sliding window approach this is the fifth problem on sliding window approach I have already published the separate video on anagram if you don't have understanding of anagram I wou...
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
215
hi guys hope you are doing great our today's problem is Keith's largest element in an array it's a medium difficulty level question on lead code and one of the most top liked questions as well so the question States finally KF largest element in an unsorted array note that it is the key eighth largest element in the so...
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
18
hello and welcome in this video we are going to solve problem number 18 of let go that is for some problem okay so before starting the video I am going to tell you that please solve question number 15 that is threesome problem before attempting this problem so if you have not solved this problem please go and solve thi...
4Sum
4sum
Given an array `nums` of `n` integers, return _an array of all the **unique** quadruplets_ `[nums[a], nums[b], nums[c], nums[d]]` such that: * `0 <= a, b, c, d < n` * `a`, `b`, `c`, and `d` are **distinct**. * `nums[a] + nums[b] + nums[c] + nums[d] == target` You may return the answer in **any order**. **Examp...
null
Array,Two Pointers,Sorting
Medium
1,15,454,2122
35
hello everyone welcome to JavaScript problem solving playlist so today's problem is called search insert position so it says that given a sorted array of distinct integer and a Target value return the index if the integer is found if not then return the index where it would be if it were inserted in order so let's visu...
Search Insert Position
search-insert-position
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with `O(log n)` runtime complexity. **Example 1:** **Input:** nums = \[1,3,5,6\], target = 5 **Output:** 2 **Exa...
null
Array,Binary Search
Easy
278
1,627
hey everybody this is larry this is me going with q4 of the recent weekly contest 211 for lead code uh where i finished 35 i guess but uh hit the like button hit the subscribe button join me on discord let me know what you think about this problem it is a tricky problem it's all math problem and i think to be honest a ...
Graph Connectivity With Threshold
last-moment-before-all-ants-fall-out-of-a-plank
We have `n` cities labeled from `1` to `n`. Two different cities with labels `x` and `y` are directly connected by a bidirectional road if and only if `x` and `y` share a common divisor **strictly greater** than some `threshold`. More formally, cities with labels `x` and `y` have a road between them if there exists an ...
The ants change their way when they meet is equivalent to continue moving without changing their direction. Answer is the max distance for one ant to reach the end of the plank in the facing direction.
Array,Brainteaser,Simulation
Medium
2317
137
Hello guys welcome to present day disney today exactly 2012 problem single number two please write the video n you don't forget to subscribe to this channel university update ki jeevan hone matiyari open teachers every element 3D effects of one witch appears at least one find a single Word Limit Note Phone Number In Sa...
Single Number II
single-number-ii
Given an integer array `nums` where every element appears **three times** except for one, which appears **exactly once**. _Find the single element and return it_. You must implement a solution with a linear runtime complexity and use only constant extra space. **Example 1:** **Input:** nums = \[2,2,3,2\] **Output:**...
null
Array,Bit Manipulation
Medium
136,260
117
welcome guys so today we are going to solve the lead code daily challenge populating next try pointers in each one second we are given a binary tree we have to populate each next pointer to a point is next right now if there is no next right node the next pointer should be none so basically given a binary tree and if s...
Populating Next Right Pointers in Each Node II
populating-next-right-pointers-in-each-node-ii
Given a binary tree struct Node { int val; Node \*left; Node \*right; Node \*next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to `NULL`. Initially, all next pointers are set to `NULL`. **Example 1:** **Input:** root = \[1,2,3...
null
Linked List,Tree,Depth-First Search,Breadth-First Search,Binary Tree
Medium
116
1,034
Hey guys welcome back to my channel and today we will do the question number 10 of the code coloring or what did you give me in your given a cross a matrix grid the grid is okay this is a matrix right and three inger row column And color one row gave us one column, one color is ok f value in the grid represents the col...
Coloring A Border
subarrays-with-k-different-integers
You are given an `m x n` integer matrix `grid`, and three integers `row`, `col`, and `color`. Each value in the grid represents the color of the grid square at that location. Two squares belong to the same **connected component** if they have the same color and are next to each other in any of the 4 directions. The *...
null
Array,Hash Table,Sliding Window,Counting
Hard
3,159,340,2186,2247
243
hi today we're looking at question 243 shortest wall distance um basically the question is given a area of strength and two other words right after that you need to find the shortest distance between them so uh if you look at example one um coding and practice the distance between practice and coding is one two three s...
Shortest Word Distance
shortest-word-distance
Given an array of strings `wordsDict` and two different strings that already exist in the array `word1` and `word2`, return _the shortest distance between these two words in the list_. **Example 1:** **Input:** wordsDict = \[ "practice ", "makes ", "perfect ", "coding ", "makes "\], word1 = "coding ", word2 = "...
null
Array,String
Easy
244,245,2320
1,639
Hello everyone welcome to my channel with mike so today we are going to do video number 23 of our playlist of dynamic framing ok and liquid number is 1639 it is a hard level question but I am pretty sir I make it very easy it is a promise ok This will be quite easy because what we always do in the question of DP is tha...
Number of Ways to Form a Target String Given a Dictionary
friendly-movies-streamed-last-month
You are given a list of strings of the **same length** `words` and a string `target`. Your task is to form `target` using the given `words` under the following rules: * `target` should be formed from left to right. * To form the `ith` character (**0-indexed**) of `target`, you can choose the `kth` character of th...
null
Database
Easy
null
508
hey everybody this is Larry and apparently there's some issues with the daily plan uh hit the like button hit the Subscribe button join me on Discord um today doing an extra bonus day or a bonus whatever uh bonus for I'm doing an extra bar uh it is Friday the 13th here in New York and people are having issues with uh w...
Most Frequent Subtree Sum
most-frequent-subtree-sum
Given the `root` of a binary tree, return the most frequent **subtree sum**. If there is a tie, return all the values with the highest frequency in any order. The **subtree sum** of a node is defined as the sum of all the node values formed by the subtree rooted at that node (including the node itself). **Example 1:*...
null
Hash Table,Tree,Depth-First Search,Binary Tree
Medium
572,2126
1,684
okay this is 1684 count the number of consistent string we have all this string cost of distinct characters structures and their way over coded world first thing is consistently for character interesting appeals in their signal okay look at the number of consistency for example number one their announced character is j...
Count the Number of Consistent Strings
find-latest-group-of-size-m
You are given a string `allowed` consisting of **distinct** characters and an array of strings `words`. A string is **consistent** if all characters in the string appear in the string `allowed`. Return _the number of **consistent** strings in the array_ `words`. **Example 1:** **Input:** allowed = "ab ", words = \[...
Since the problem asks for the latest step, can you start the searching from the end of arr? Use a map to store the current “1” groups. At each step (going backwards) you need to split one group and update the map.
Array,Binary Search,Simulation
Medium
null
451
hey everybody this is Larry this is me doing uh day three of the decemberly code day challenge oh excuse me hit the like button hit the Subscribe button join me on Discord let me know what you think about today's poem I'm probably gonna do an extra one just to warm up a little bit for the Advent of code that I've been ...
Sort Characters By Frequency
sort-characters-by-frequency
Given a string `s`, sort it in **decreasing order** based on the **frequency** of the characters. The **frequency** of a character is the number of times it appears in the string. Return _the sorted string_. If there are multiple answers, return _any of them_. **Example 1:** **Input:** s = "tree " **Output:** "eer...
null
Hash Table,String,Sorting,Heap (Priority Queue),Bucket Sort,Counting
Medium
347,387,1741
1,877
hello everyone let's solve the today's LOD challenge which is minimize maximum pair sum in an array so in this problem we are given an array of integer numbers and what we have to do is we have to maximize the pair sum such that the maximum pair sum which we are getting is minimized in this array so let's have a look o...
Minimize Maximum Pair Sum in Array
find-followers-count
The **pair sum** of a pair `(a,b)` is equal to `a + b`. The **maximum pair sum** is the largest **pair sum** in a list of pairs. * For example, if we have pairs `(1,5)`, `(2,3)`, and `(4,4)`, the **maximum pair sum** would be `max(1+5, 2+3, 4+4) = max(6, 5, 8) = 8`. Given an array `nums` of **even** length `n`, pai...
null
Database
Easy
null
107
hello everybody welcome to my channel hope you are enjoying the coding and today is a very famous problem on tree which is a binary tree level order traversal part two so in this problem it is given as a binary tree and we have to print the label order traversal but not from the root to bottom but we have to print from...
Binary Tree Level Order Traversal II
binary-tree-level-order-traversal-ii
Given the `root` of a binary tree, return _the bottom-up level order traversal of its nodes' values_. (i.e., from left to right, level by level from leaf to root). **Example 1:** **Input:** root = \[3,9,20,null,null,15,7\] **Output:** \[\[15,7\],\[9,20\],\[3\]\] **Example 2:** **Input:** root = \[1\] **Output:** \[...
null
Tree,Breadth-First Search,Binary Tree
Medium
102,637
1,869
hey everybody this is larry just me go over q1 of the weekly contest 242 uh longer contiguous segments of one than zeros um i think this one is pretty straight forward to be honest um it's just you know there's a lot of different ways to do it implementation wise but as long as you kind of keep it uh you know even uh y...
Longer Contiguous Segments of Ones than Zeros
longer-contiguous-segments-of-ones-than-zeros
Given a binary string `s`, return `true` _if the **longest** contiguous segment of_ `1`'_s is **strictly longer** than the **longest** contiguous segment of_ `0`'_s in_ `s`, or return `false` _otherwise_. * For example, in `s = "110100010 "` the longest continuous segment of `1`s has length `2`, and the longest cont...
null
null
Easy
null
1,716
start today's daily question calculate money in the Lal bank and like um hery wants to save money for his first carard so he put like some money into the bank every day he started by putting $1 on every day he started by putting $1 on every day he started by putting $1 on Monday and the first day every day from like Tu...
Calculate Money in Leetcode Bank
maximum-non-negative-product-in-a-matrix
Hercy wants to save money for his first car. He puts money in the Leetcode bank **every day**. He starts by putting in `$1` on Monday, the first day. Every day from Tuesday to Sunday, he will put in `$1` more than the day before. On every subsequent Monday, he will put in `$1` more than the **previous Monday**. Given...
Use Dynamic programming. Keep the highest value and lowest value you can achieve up to a point.
Array,Dynamic Programming,Matrix
Medium
null
207
today we will solve a course scheduling problem here you are given a list of courses and you are also given their dependencies that is which course depends on which course so the course on which some other course is dependent is called the prerequisite course of that course so you are given a pair of a list of such pai...
Course Schedule
course-schedule
There are a total of `numCourses` courses you have to take, labeled from `0` to `numCourses - 1`. You are given an array `prerequisites` where `prerequisites[i] = [ai, bi]` indicates that you **must** take course `bi` first if you want to take course `ai`. * For example, the pair `[0, 1]`, indicates that to take cou...
This problem is equivalent to finding if a cycle exists in a directed graph. If a cycle exists, no topological ordering exists and therefore it will be impossible to take all courses. Topological Sort via DFS - A great video tutorial (21 minutes) on Coursera explaining the basic concepts of Topological Sort. Topologica...
Depth-First Search,Breadth-First Search,Graph,Topological Sort
Medium
210,261,310,630
1,632
welcome to august 8th sleep code challenge rank transform of a matrix given m by n matrix return a new matrix answer where answer at row and column is the rank of the matrix row column the rank is an integer that represents how large an element is compared to other elements it is calculated using the following rules th...
Rank Transform of a Matrix
number-of-good-ways-to-split-a-string
Given an `m x n` `matrix`, return _a new matrix_ `answer` _where_ `answer[row][col]` _is the_ _**rank** of_ `matrix[row][col]`. The **rank** is an **integer** that represents how large an element is compared to other elements. It is calculated using the following rules: * The rank is an integer starting from `1`. *...
Use two HashMap to store the counts of distinct letters in the left and right substring divided by the current index.
String,Dynamic Programming,Bit Manipulation
Medium
null
1,883
hey everybody this is larry this is me going with q4 of the leeco weekly contest 243 uh minimum skips to arrive at meeting on time so not many people got this one during the contest i actually i have some complaints about this one uh i spiritual um i have a moral victory which is the only victory i have today uh of sol...
Minimum Skips to Arrive at Meeting On Time
find-distance-in-a-binary-tree
You are given an integer `hoursBefore`, the number of hours you have to travel to your meeting. To arrive at your meeting, you have to travel through `n` roads. The road lengths are given as an integer array `dist` of length `n`, where `dist[i]` describes the length of the `ith` road in **kilometers**. In addition, you...
Get the LCA of p and q. The answer is the sum of distances between p-LCA and q-LCA
Hash Table,Tree,Depth-First Search,Breadth-First Search,Binary Tree
Medium
2217
88
hi guys welcome to algorithms made easy today we will see the question merge sorted array given two sorted integer arrays nums one and nums two merged nums two into nums one as one sorted array the numbers of element initialized in nums one and nums two are m and n respectively you may assume that nums one has enough s...
Merge Sorted Array
merge-sorted-array
You are given two integer arrays `nums1` and `nums2`, sorted in **non-decreasing order**, and two integers `m` and `n`, representing the number of elements in `nums1` and `nums2` respectively. **Merge** `nums1` and `nums2` into a single array sorted in **non-decreasing order**. The final sorted array should not be re...
You can easily solve this problem if you simply think about two elements at a time rather than two arrays. We know that each of the individual arrays is sorted. What we don't know is how they will intertwine. Can we take a local decision and arrive at an optimal solution? If you simply consider one element each at a ti...
Array,Two Pointers,Sorting
Easy
21,1019,1028
131
Hello friends today I'm going to solve it could problem number 131 palindrome partitioning so in this problem we are given a string s and we need to partition this string such that every substring is partitioned into a palindrome and we are going to return all the palindrome partitioning off as so what's a palindrome i...
Palindrome Partitioning
palindrome-partitioning
Given a string `s`, partition `s` such that every substring of the partition is a **palindrome**. Return _all possible palindrome partitioning of_ `s`. **Example 1:** **Input:** s = "aab" **Output:** \[\["a","a","b"\],\["aa","b"\]\] **Example 2:** **Input:** s = "a" **Output:** \[\["a"\]\] **Constraints:** * `1...
null
String,Dynamic Programming,Backtracking
Medium
132,1871
1,993
hello uh let's do this question i just did it took me way too long so i don't want to edit that you're given a tree but you can lock and unlock a node if you lock a node given a user only that user can unlock the node and no other user can it can only lock a node if it's already unlocked and there's also another functi...
Operations on Tree
sum-of-all-subset-xor-totals
You are given a tree with `n` nodes numbered from `0` to `n - 1` in the form of a parent array `parent` where `parent[i]` is the parent of the `ith` node. The root of the tree is node `0`, so `parent[0] = -1` since it has no parent. You want to design a data structure that allows users to lock, unlock, and upgrade node...
Is there a way to iterate through all the subsets of the array? Can we use recursion to efficiently iterate through all the subsets?
Array,Math,Backtracking,Bit Manipulation,Combinatorics
Easy
null
335
uh today we're gonna working on lead code question number 335 self crossing uh you have been given an array of integers called distance okay uh so you start at point zero and on an x5 plane and you move the first element in the distance array me uh that's gonna be we're gonna moving that much uh to the north then to th...
Self Crossing
self-crossing
You are given an array of integers `distance`. You start at the point `(0, 0)` on an **X-Y plane,** and you move `distance[0]` meters to the north, then `distance[1]` meters to the west, `distance[2]` meters to the south, `distance[3]` meters to the east, and so on. In other words, after each move, your direction chan...
null
Array,Math,Geometry
Hard
null
122
all right so let's take a look at this problem this one is called best time to buy and sell stock two it's another array problem and again what as i said in my previous video if you're thinking about a raise you're probably going to be thinking do i need to sort the array should i use an alternate index should i also m...
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
1,424
I hope that you guys are doing good let's see this problem diagonal Traverse 2 it has been asked by Facebook in this last 6 months three times that's a big number and last one year VMware and Google let's quickly see what this says is just that I'll show you two techniques to solve it and the better optimization to sol...
Diagonal Traverse II
maximum-candies-you-can-get-from-boxes
Given a 2D integer array `nums`, return _all elements of_ `nums` _in diagonal order as shown in the below images_. **Example 1:** **Input:** nums = \[\[1,2,3\],\[4,5,6\],\[7,8,9\]\] **Output:** \[1,4,2,7,5,3,8,6,9\] **Example 2:** **Input:** nums = \[\[1,2,3,4,5\],\[6,7\],\[8\],\[9,10,11\],\[12,13,14,15,16\]\] **Ou...
Use Breadth First Search (BFS) to traverse all possible boxes you can open. Only push to the queue the boxes the you have with their keys.
Array,Breadth-First Search
Hard
null
234
Hi welcome to question series and here we are going to attempt question number 234 which is the first question on 'Likeless', it is 234 which is the first question on 'Likeless', it is 234 which is the first question on 'Likeless', it is an easy level difficult question with very high courts and there are some minimal ...
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
489
all right hey there everyone the problem today we are gonna be solving is called robot room cleaner it's a hard implementation business problem so let me just go through this problem once you are controlling a robot that is located somewhere in a room the room is modeled as an m cross m binary grid where zero represent...
Robot Room Cleaner
kth-smallest-instructions
You are controlling a robot that is located somewhere in a room. The room is modeled as an `m x n` binary grid where `0` represents a wall and `1` represents an empty slot. The robot starts at an unknown location in the room that is guaranteed to be empty, and you do not have access to the grid, but you can move the r...
There are nCr(row + column, row) possible instructions to reach (row, column). Try building the instructions one step at a time. How many instructions start with "H", and how does this compare with k?
Array,Math,Dynamic Programming,Combinatorics
Hard
null
322
in this video we'll go over lead code question number 322 coin change now if you haven't seen my video on lead code question 70 climbing stairs I highly recommend you watch that first coin change is a very similar problem to climbing stairs but it's harder the link is in the description so please go watch that first ok...
Coin Change
coin-change
You are given an integer array `coins` representing coins of different denominations and an integer `amount` representing a total amount of money. Return _the fewest number of coins that you need to make up that amount_. If that amount of money cannot be made up by any combination of the coins, return `-1`. You may a...
null
Array,Dynamic Programming,Breadth-First Search
Medium
1025,1393,2345
1,013
all right so this question partition to three parts with equal sum so G the array we can choose if you can partition the array into three different part of the uh equal sum so what does this mean so imagine you know you cut into three piece and then you say AAL to Bal to C the S of the array are equal so the first cond...
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
1,334
Hello Everyone Should Come Forward To Pandit Slept For Half An Hour And Some Number 123 Phone Adhisankhya Medium Difficult Problems And Stir Well - Festivals And Subscribe And Share Subscribe To That Soha Then Yagyavan The Number Of City St. George Subscribe And You Must And Distance Between Cities Subscribe Must Subsc...
Find the City With the Smallest Number of Neighbors at a Threshold Distance
find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
There are `n` cities numbered from `0` to `n-1`. Given the array `edges` where `edges[i] = [fromi, toi, weighti]` represents a bidirectional and weighted edge between cities `fromi` and `toi`, and given the integer `distanceThreshold`. Return the city with the smallest number of cities that are reachable through some ...
null
null
Medium
null
110
what's up guys in this video we're going to solve this problem balanced binary tree given a binary tree determine if it is height balanced what is a height balanced binary tree a binary tree is a balanced binary tree if the difference in height of left and right subtrees for every node no more than one now we understan...
Balanced Binary Tree
balanced-binary-tree
Given a binary tree, determine if it is **height-balanced**. **Example 1:** **Input:** root = \[3,9,20,null,null,15,7\] **Output:** true **Example 2:** **Input:** root = \[1,2,2,3,3,null,null,4,4\] **Output:** false **Example 3:** **Input:** root = \[\] **Output:** true **Constraints:** * The number of nodes ...
null
Tree,Depth-First Search,Binary Tree
Easy
104
208
Hello friends today I'm going to solve liquid problem number 208 Implement try prefix tree so what is a try is a data structure used to efficiently store and retrieve keys in a data set of strings um and it has various applications including Auto completion and spell checker so basically what does try look like let's s...
Implement Trie (Prefix Tree)
implement-trie-prefix-tree
A [**trie**](https://en.wikipedia.org/wiki/Trie) (pronounced as "try ") or **prefix tree** is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker. Implement the Trie class: * `Trie()` ...
null
Hash Table,String,Design,Trie
Medium
211,642,648,676,1433,1949
1,629
Hello Hi Everyone Welcome Platform Programming In This Video Highlight Kaise Bataunga Last Ke Jin Fact That Of Clans Previous Under Different Level Vs So Let Me Clear Per Distraction Few Minutes Ago Ki Sudhir Winchester Country Advertise Takreer Wah Along With Ther Respective Resist Saunf Band Stream The content itself...
Slowest Key
minimum-possible-integer-after-at-most-k-adjacent-swaps-on-digits
A newly designed keypad was tested, where a tester pressed a sequence of `n` keys, one at a time. You are given a string `keysPressed` of length `n`, where `keysPressed[i]` was the `ith` key pressed in the testing sequence, and a sorted list `releaseTimes`, where `releaseTimes[i]` was the time the `ith` key was releas...
We want to make the smaller digits the most significant digits in the number. For each index i, check the smallest digit in a window of size k and append it to the answer. Update the indices of all digits in this range accordingly.
String,Greedy,Binary Indexed Tree,Segment Tree
Hard
null
198
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 House robber so in this question it states that a professional robber is planning to rob houses along a street each house has certain amount of money stats and the only constant stopping you from robbin...
House Robber
house-robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and **it will automatically contact the police if two adjacent houses were broken into...
null
Array,Dynamic Programming
Medium
152,213,256,276,337,600,656,740,2262
1,046
and then when there is no argument at all it will be smallest on top let's see that we have the first insertion in here so we only have negative two and that's it we don't have anything so it will be on the top and negative 2 in here then we will insert negative seven it will be on the top why this is how it works so t...
Last Stone Weight
max-consecutive-ones-iii
You are given an array of integers `stones` where `stones[i]` is the weight of the `ith` stone. We are playing a game with the stones. On each turn, we choose the **heaviest two stones** and smash them together. Suppose the heaviest two stones have weights `x` and `y` with `x <= y`. The result of this smash is: * I...
One thing's for sure, we will only flip a zero if it extends an existing window of 1s. Otherwise, there's no point in doing it, right? Think Sliding Window! Since we know this problem can be solved using the sliding window construct, we might as well focus in that direction for hints. Basically, in a given window, we c...
Array,Binary Search,Sliding Window,Prefix Sum
Medium
340,424,485,487,2134
1,268
hey everyone welcome back and let's write some more neat code today so today let's solve the problem search suggestions system we're given an array of strings products and we're given a search word and we sort of want to design a system that kind of simulates for the search word that we're given in this case mouse we'r...
Search Suggestions System
market-analysis-i
You are given an array of strings `products` and a string `searchWord`. Design a system that suggests at most three product names from `products` after each character of `searchWord` is typed. Suggested products should have common prefix with `searchWord`. If there are more than three products with a common prefix ret...
null
Database
Medium
null
1,547
hey what's up guys i came back once again i'm back today we're gonna be doing another problem 15 47 minimum cost to cut a stick so given a wooden stick of length n units the stick is labeled from 0 to n for example a stick of length six is labeled as follows so we have zero one two three four five six given integer arr...
Minimum Cost to Cut a Stick
destination-city
Given a wooden stick of length `n` units. The stick is labelled from `0` to `n`. For example, a stick of length **6** is labelled as follows: Given an integer array `cuts` where `cuts[i]` denotes a position you should perform a cut at. You should perform the cuts in order, you can change the order of the cuts as you ...
Start in any city and use the path to move to the next city. Eventually, you will reach a city with no path outgoing, this is the destination city.
Hash Table,String
Easy
null
38
Hello friends today I'm going to solve liquid problem number 38 count and say so in this question we are actually given an integer n and we need to return a string so how do we actually what is this question about let me just explain it in an exam here uh with an example so suppose and is equals to four um then what ar...
Count and Say
count-and-say
The **count-and-say** sequence is a sequence of digit strings defined by the recursive formula: * `countAndSay(1) = "1 "` * `countAndSay(n)` is the way you would "say " the digit string from `countAndSay(n-1)`, which is then converted into a different digit string. To determine how you "say " a digit string, spli...
The following are the terms from n=1 to n=10 of the count-and-say sequence: 1. 1 2. 11 3. 21 4. 1211 5. 111221 6. 312211 7. 13112221 8. 1113213211 9. 31131211131221 10. 13211311123113112211 To generate the nth term, just count and say the n-1th term.
String
Medium
271,443
48
Loot Hello friends, today we will look at rotating the matrix, clock wise, for this you can understand it simply, this is a matrix, when you rotate the matrix, how will the image of the matrix be formed, you may have a question in this, United Degree on Transport Clockwise In this type of post, you can clear it in this...
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
129
what's of Likud 129 some root to leaf numbers so I like this problem because it's a pretty straightforward problem you don't really need to know any super crazy tricks or anything to solve it so let's get right into it so for each leaf node there exists a path from the root right so for example this leaf node 5 there's...
Sum Root to Leaf Numbers
sum-root-to-leaf-numbers
You are given the `root` of a binary tree containing digits from `0` to `9` only. Each root-to-leaf path in the tree represents a number. * For example, the root-to-leaf path `1 -> 2 -> 3` represents the number `123`. Return _the total sum of all root-to-leaf numbers_. Test cases are generated so that the answer w...
null
Tree,Depth-First Search,Binary Tree
Medium
112,124,1030
1,171
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 remove Zero Sum consecutive nodes from link list so we are given the head of a link list we repeatedly delete consecutive sequences of nodes that sum to zero until there are no such sequences inside the...
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
223
hey folks welcome back to another video we're looking at question 223 a rectangle area the wave will be solving this problem is by looking at the coordinates that are given to us and figuring out the length and the breadth for the given rectangles and calculating the area once we have that we need to figure out whether...
Rectangle Area
rectangle-area
Given the coordinates of two **rectilinear** rectangles in a 2D plane, return _the total area covered by the two rectangles_. The first rectangle is defined by its **bottom-left** corner `(ax1, ay1)` and its **top-right** corner `(ax2, ay2)`. The second rectangle is defined by its **bottom-left** corner `(bx1, by1)` ...
null
Math,Geometry
Medium
866
503
Ajay has got Diwakar for uploading today in this video we are going to illuminate the Next Greater Element, so it is a very strong prerequisite for Next Greater Element on right, so if you have not done it then solve it first on SIM so that You should understand the logic here better also. Okay, let's see this question...
Next Greater Element II
next-greater-element-ii
Given a circular integer array `nums` (i.e., the next element of `nums[nums.length - 1]` is `nums[0]`), return _the **next greater number** for every element in_ `nums`. The **next greater number** of a number `x` is the first greater number to its traversing-order next in the array, which means you could search circu...
null
Array,Stack,Monotonic Stack
Medium
496,556
1,872
hey what's up guys uh this is chung here again so this time number 1872 stone game eight i believe wow a lot of stone games okay so this time i listened bob uh playing another stone game and so this time the rules like it's like this so there we have unstones uh in a row right down each player's turn uh while the numbe...
Stone Game VIII
can-you-eat-your-favorite-candy-on-your-favorite-day
Alice and Bob take turns playing a game, with **Alice starting first**. There are `n` stones arranged in a row. On each player's turn, while the number of stones is **more than one**, they will do the following: 1. Choose an integer `x > 1`, and **remove** the leftmost `x` stones from the row. 2. Add the **sum** of...
The query is true if and only if your favorite day is in between the earliest and latest possible days to eat your favorite candy. To get the earliest day, you need to eat dailyCap candies every day. To get the latest day, you need to eat 1 candy every day. The latest possible day is the total number of candies with a ...
Array,Prefix Sum
Medium
null
986
all right so lead code time for today interval list intersections um in this video we are going to tell you how to solve this problem and how to solve this problem properly in the interview then let's get started so the first thing is to understand the problem and try to clarify if there is anything you don't understan...
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
289
hello everyone welcome or welcome back to my channel so today we are going to discuss another problem is game of life very easy problem so in this problem a board is given which is a m cross n grid where each cell has an initial state live represented by one or dead represented by zero so each cell interact with its ei...
Game of Life
game-of-life
According to [Wikipedia's article](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life): "The **Game of Life**, also known simply as **Life**, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. " The board is made up of an `m x n` grid of cells, where each cell has an initial st...
null
Array,Matrix,Simulation
Medium
73
70
hello everyone let's look at climbing stairs the problem statement is we are climbing a staircase it takes n steps to reach the top each time we can only climb one or two steps how many distinct ways we can climb to the top example one input is two output is also two there are two ways to climb to the top it's one plus...
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
330
Luta Suspend Are Problem From Which Cold Be Considered As A Chronic Easy And Minimum Level Problem Bomb Blast Time For VHP When And Also Quite At That Time Element In All The Number One To Three For Wife In Element In The Return Of The Day That Commercial vehicle is me now so let's tree on maximum clear example we shap...
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
1,011
welcome to code Sutra in fact this is the first problem that I have solved on this particular Channel about a month ago in this video I'll be discussing about lead code problem number 1011 capacity to ship packages within DDS the approach to this particular problem might not be very intuitive but once you understand th...
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
994
Hai Bhai Kalyan Loot Se Hai Dish to Shri Ram Hope it will be very good and will grow well with our placement pressure series Our question of today is That is very good and why is it a standard question And only and only why, a lot, now that we have moved ahead, graphs etc. will be read, TV etc. will be read, then in th...
Rotting Oranges
prison-cells-after-n-days
You are given an `m x n` `grid` where each cell can have one of three values: * `0` representing an empty cell, * `1` representing a fresh orange, or * `2` representing a rotten orange. Every minute, any fresh orange that is **4-directionally adjacent** to a rotten orange becomes rotten. Return _the minimum nu...
null
Array,Hash Table,Math,Bit Manipulation
Medium
null
211
hello everyone welcome to quartus camp we are at 28th day of january lead code challenge and the problem we are going to cover in this video is design add and search words data structure so here the problem statement asks us to design three methods or a class word dictionary which has three methods the first method is ...
Design Add and Search Words Data Structure
design-add-and-search-words-data-structure
Design a data structure that supports adding new words and finding if a string matches any previously added string. Implement the `WordDictionary` class: * `WordDictionary()` Initializes the object. * `void addWord(word)` Adds `word` to the data structure, it can be matched later. * `bool search(word)` Returns ...
You should be familiar with how a Trie works. If not, please work on this problem: Implement Trie (Prefix Tree) first.
String,Depth-First Search,Design,Trie
Medium
208,746
303
what's going on so i decided let's do the ring some query for immutable so i just did a mutable one which is uh use the fenwick tree could have also used a segment tree which i'm um i'm gonna learn those in a bit but this is this problem just requires using a prefix summary it's very simple so literally uh i would go t...
Range Sum Query - Immutable
range-sum-query-immutable
Given an integer array `nums`, handle multiple queries of the following type: 1. Calculate the **sum** of the elements of `nums` between indices `left` and `right` **inclusive** where `left <= right`. Implement the `NumArray` class: * `NumArray(int[] nums)` Initializes the object with the integer array `nums`. * ...
null
Array,Design,Prefix Sum
Easy
304,307,325
1,637
hey everyone today we're working on leak code challenge 1637. in this challenge our input is an array called points and we're given coordinates with X and Y values and they want you to return the widest vertical area between two points such that no points are inside the area so what does that mean what are they asking ...
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
67
hello welcome to my channel today we have leeco 67 at binary so give two binary string a and b return the sum as a dot binary string so now we have a b here 11 plus one when one plus one is equal to zero and we have additional one added to the second digit and then you have two added to another digit so we come up one ...
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
203
hello everyone welcome to codas camp we are at 11th day of november eco challenge and the problem we are going to cover in this video is to remove linked list elements so if you observe the problems that has been asked during the normal eco challenge are mostly easy category problems so it is always good to revise the ...
Remove Linked List Elements
remove-linked-list-elements
Given the `head` of a linked list and an integer `val`, remove all the nodes of the linked list that has `Node.val == val`, and return _the new head_. **Example 1:** **Input:** head = \[1,2,6,3,4,5,6\], val = 6 **Output:** \[1,2,3,4,5\] **Example 2:** **Input:** head = \[\], val = 1 **Output:** \[\] **Example 3:**...
null
Linked List,Recursion
Easy
27,237,2216
225
hi everyone today we are going to sort of delete all the question Implement stack using fuse so Implement a lasting passed out stack using only two cues the implemented stack should support all the functions of normal stack push top pop and empty and here is a definition of each function and we have actually follow-up ...
Implement Stack using Queues
implement-stack-using-queues
Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (`push`, `top`, `pop`, and `empty`). Implement the `MyStack` class: * `void push(int x)` Pushes element x to the top of the stack. * `int pop()` Removes the element on the top...
null
Stack,Design,Queue
Easy
232
237
Hello Hi Guys Welcome To Your Dreams Media Ji Today Will Go Through The Day To Problems From June Challenge Did Not Please Like Video And Don't Forget To Subscribe To This Channel Show Me To Right To Delete Function In Nursing Link List Jeevan Access Only To The Node For Example Diwan Agdat Input Least This Session and...
Delete Node in a Linked List
delete-node-in-a-linked-list
There is a singly-linked list `head` and we want to delete a node `node` in it. You are given the node to be deleted `node`. You will **not be given access** to the first node of `head`. All the values of the linked list are **unique**, and it is guaranteed that the given node `node` is not the last node in the linke...
null
Linked List
Easy
203
106
in this video we are going to discuss if you have given the in order and the post order Professor how you can build up or create the banuity but before going to deep inside the problem let us understand what is the traversal what is the in order to reversal what is the post order triggers right so you know this is the ...
Construct Binary Tree from Inorder and Postorder Traversal
construct-binary-tree-from-inorder-and-postorder-traversal
Given two integer arrays `inorder` and `postorder` where `inorder` is the inorder traversal of a binary tree and `postorder` is the postorder traversal of the same tree, construct and return _the binary tree_. **Example 1:** **Input:** inorder = \[9,3,15,20,7\], postorder = \[9,15,7,20,3\] **Output:** \[3,9,20,null,n...
null
Array,Hash Table,Divide and Conquer,Tree,Binary Tree
Medium
105
1,849
hey everyone welcome back and let's write some more neat code today so today let's solve a brand new leak code problem just from the elite code contest that just ended a second ago 1849 splitting a string into descending consecutive values so this is a pretty standard backtracking problem so we're going to be handling ...
Splitting a String Into Descending Consecutive Values
maximum-absolute-sum-of-any-subarray
You are given a string `s` that consists of only digits. Check if we can split `s` into **two or more non-empty substrings** such that the **numerical values** of the substrings are in **descending order** and the **difference** between numerical values of every two **adjacent** **substrings** is equal to `1`. * Fo...
What if we asked for maximum sum, not absolute sum? It's a standard problem that can be solved by Kadane's algorithm. The key idea is the max absolute sum will be either the max sum or the min sum. So just run kadane twice, once calculating the max sum and once calculating the min sum.
Array,Dynamic Programming
Medium
53
55
Hello guys welcome back door sign in this video will see job game problem this is from list to date 154 248 coding challenge this problem is also known as the minimum number of dams to reach and bird in this problem is a subset of this problem solve this Problem IS Currently Have A Lower Cost So Let's Look At Problem G...
Jump Game
jump-game
You are given an integer array `nums`. You are initially positioned at the array's **first index**, and each element in the array represents your maximum jump length at that position. Return `true` _if you can reach the last index, or_ `false` _otherwise_. **Example 1:** **Input:** nums = \[2,3,1,1,4\] **Output:** t...
null
Array,Dynamic Programming,Greedy
Medium
45,1428,2001
412
and answer of I equal to I as a string which we should written there if none of the upper conditions are true so let's say the given n is 3. then the answer array you have to write an answer that is one index which the indexing should start from what so 1 comma 2 comma 3 so from 1 till the nth number we could see one u...
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
1,817
all right let's talk about the final user active minutes so you have a locked log array so log i represent id and time so the multiple user can perform action simultaneously and a single user can perform multiple actions in a seven minutes but the problem is uh the uam the user active minutes for a given user is define...
Finding the Users Active Minutes
calculate-money-in-leetcode-bank
You are given the logs for users' actions on LeetCode, and an integer `k`. The logs are represented by a 2D integer array `logs` where each `logs[i] = [IDi, timei]` indicates that the user with `IDi` performed an action at the minute `timei`. **Multiple users** can perform actions simultaneously, and a single user can...
Simulate the process by keeping track of how much money John is putting in and which day of the week it is, and use this information to deduce how much money John will put in the next day.
Math
Easy
null
1,920
hey everybody this is larry this is me going over q1 of the weekly contest 248 built away from permutation uh hit the like button hit the subscribe button join me on discord let me know what you think about this problem um yeah and i usually go over this in my discord after the contest so if you're into doing contests ...
Build Array from Permutation
determine-color-of-a-chessboard-square
Given a **zero-based permutation** `nums` (**0-indexed**), build an array `ans` of the **same length** where `ans[i] = nums[nums[i]]` for each `0 <= i < nums.length` and return it. A **zero-based permutation** `nums` is an array of **distinct** integers from `0` to `nums.length - 1` (**inclusive**). **Example 1:** *...
Convert the coordinates to (x, y) - that is, "a1" is (1, 1), "d7" is (4, 7). Try add the numbers together and look for a pattern.
Math,String
Easy
null
191
Hello friends welcome to my channel here solve C problems and prepared to the C interview today's problem number is 1 191 number of one bits write F function that takes the binary representation of the insigned integer it Returns the number of one bits it has El known as the harming weight mhm so let's solve it actuall...
Number of 1 Bits
number-of-1-bits
Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the [Hamming weight](http://en.wikipedia.org/wiki/Hamming_weight)). **Note:** * Note that in some languages, such as Java, there is no unsigned integer type. In this case, the input ...
null
Bit Manipulation
Easy
190,231,338,401,461,693,767
1,637
hello everyone welcome to my programming club today we will be solving another daily code Challenge and the challenge name is widest vertical area between two points containing no points so let me explain this problem statement in my own words uh basically what you are given is you are given an 2D array a 2d array of p...
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
445
Hi apni sister absolutely back tu take ranaaj in this video we will be discussing a problem statement numbers so what have we given in this question create two non empty lists and what are those two non empty lists telling non negative inteasers ok And what it said is that the most significant digital will come on the ...
Add Two Numbers II
add-two-numbers-ii
You are given two **non-empty** linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itsel...
null
Linked List,Math,Stack
Medium
2,1774
149
hi guys in this video we are going to discuss the daily lead code challenge for 8th of January the problem's name is Max point on a line Max points online it has been categorized as a hard problem however it's pretty simple to do I don't know why they have characters it has a hard problem the only thing you're required...
Max Points on a Line
max-points-on-a-line
Given an array of `points` where `points[i] = [xi, yi]` represents a point on the **X-Y** plane, return _the maximum number of points that lie on the same straight line_. **Example 1:** **Input:** points = \[\[1,1\],\[2,2\],\[3,3\]\] **Output:** 3 **Example 2:** **Input:** points = \[\[1,1\],\[3,2\],\[5,3\],\[4,1\]...
null
Array,Hash Table,Math,Geometry
Hard
356,2287
1,704
So today we will not make labor in which we will slowly challenge the late December and solve all the problems. Today the first question is so determine if strings are half alive so let us look at this question on the right foot like come man take we have some swing given. Like it is given in book, then we have to divi...
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
127
hello everyone welcome or welcome back to my channel so today we are going to discuss another problem but before going forward if you have not liked the video please like it subscribe to my channel and hit the bell icon so that you get notified whenever i post a new video so without any further ado let's get started so...
Word Ladder
word-ladder
A **transformation sequence** from word `beginWord` to word `endWord` using a dictionary `wordList` is a sequence of words `beginWord -> s1 -> s2 -> ... -> sk` such that: * Every adjacent pair of words differs by a single letter. * Every `si` for `1 <= i <= k` is in `wordList`. Note that `beginWord` does not need ...
null
Hash Table,String,Breadth-First Search
Hard
126,433
123
hi everyone welcome back to my YouTube channel and today we'll be discussing next problem based on stocks which is again one of the hardest problems of Heathcote so I want all you guys to please pause the video for once and please read the question so I hope you all must have read the question for all those who have no...
Best Time to Buy and Sell Stock III
best-time-to-buy-and-sell-stock-iii
You are given an array `prices` where `prices[i]` is the price of a given stock on the `ith` day. Find the maximum profit you can achieve. You may complete **at most two transactions**. **Note:** You may not engage in multiple transactions simultaneously (i.e., you must sell the stock before you buy again). **Exampl...
null
Array,Dynamic Programming
Hard
121,122,188,689
724
hello in this video we are going to discuss the lead code problem number 724 find pivot index they will give you an array as input you need to return the pivot index what is remote index if you sum the elements from the left at the same time if you sum from the elements right the total of the left side elements and the...
Find Pivot Index
find-pivot-index
Given an array of integers `nums`, calculate the **pivot index** of this array. The **pivot index** is the index where the sum of all the numbers **strictly** to the left of the index is equal to the sum of all the numbers **strictly** to the index's right. If the index is on the left edge of the array, then the left...
We can precompute prefix sums P[i] = nums[0] + nums[1] + ... + nums[i-1]. Then for each index, the left sum is P[i], and the right sum is P[P.length - 1] - P[i] - nums[i].
Array,Prefix Sum
Easy
560,2102,2369
1,255
Yes, hello, this is Live Coding Paris. Today, we will solve the problem with lead code 1255, Maximum Score World Form by Lateral. The difficulty level of the problem is hard, but the correct answer rate is a little over 70%. As of little over 70%. As of little over 70%. As of today, March 7, 2023. Since it is a problem...
Maximum Score Words Formed by Letters
reverse-subarray-to-maximize-array-value
Given a list of `words`, list of single `letters` (might be repeating) and `score` of every character. Return the maximum score of **any** valid set of words formed by using the given letters (`words[i]` cannot be used two or more times). It is not necessary to use all characters in `letters` and each letter can only...
What's the score after reversing a sub-array [L, R] ? It's the score without reversing it + abs(a[R] - a[L-1]) + abs(a[L] - a[R+1]) - abs(a[L] - a[L-1]) - abs(a[R] - a[R+1]) How to maximize that formula given that abs(x - y) = max(x - y, y - x) ? This can be written as max(max(a[R] - a[L - 1], a[L - 1] - a[R]) + max(a[...
Array,Math,Greedy
Hard
null
1,470
Work in this field Ajay Ko Ki A [ Ki A [ Ki A Hello Everyone Welcome To New Video Hindi Video By Going To Discuss Another Problem From Light To Turn Key Problem This Problem 1470 Successful Problem Hi Problem Appoint Consisting Of Entertainment Channel Subscribing Do n't forget to subscribe, now we are the first to sub...
Shuffle the Array
tweet-counts-per-frequency
Given the array `nums` consisting of `2n` elements in the form `[x1,x2,...,xn,y1,y2,...,yn]`. _Return the array in the form_ `[x1,y1,x2,y2,...,xn,yn]`. **Example 1:** **Input:** nums = \[2,5,1,3,4,7\], n = 3 **Output:** \[2,3,5,4,1,7\] **Explanation:** Since x1\=2, x2\=5, x3\=1, y1\=3, y2\=4, y3\=7 then the answer ...
null
Hash Table,Binary Search,Design,Sorting,Ordered Set
Medium
null
93
everyone today we are going to solve a restore IP addresses lead code problem so in this problem the input is a string and we have to find all possible valid IP addresses for the input string let's go to the problem description a valid IP address consists of exactly four integers separated by single dots each integer i...
Restore IP Addresses
restore-ip-addresses
A **valid IP address** consists of exactly four integers separated by single dots. Each integer is between `0` and `255` (**inclusive**) and cannot have leading zeros. * For example, `"0.1.2.201 "` and `"192.168.1.1 "` are **valid** IP addresses, but `"0.011.255.245 "`, `"192.168.1.312 "` and `"192.168@1.1 "` are **...
null
String,Backtracking
Medium
752
1,219
Hello viewers welcome back to my channel I hope you are doing all the video this time uploading today's problem is path maximum gold in gold mine grade security dash kholo video every time you all the position of love you khan tweet difference more than once Visited Several vid0 Got You Can Start and Stop Collecting Go...
Path with Maximum Gold
longest-well-performing-interval
In a gold mine `grid` of size `m x n`, each cell in this mine has an integer representing the amount of gold in that cell, `0` if it is empty. Return the maximum amount of gold you can collect under the conditions: * Every time you are located in a cell you will collect all the gold in that cell. * From your posi...
Make a new array A of +1/-1s corresponding to if hours[i] is > 8 or not. The goal is to find the longest subarray with positive sum. Using prefix sums (PrefixSum[i+1] = A[0] + A[1] + ... + A[i]), you need to find for each j, the smallest i < j with PrefixSum[i] + 1 == PrefixSum[j].
Array,Hash Table,Stack,Monotonic Stack,Prefix Sum
Medium
null
1,371
Hello viewers welcome back to my channel Divya Ko Into Some Very Interesting Read Problem No. 170 Longest Born in WWE Champion Account Okay so let's understand the problems that will give you strength as returns follow difficult in this will give a number of times the egos are amazed To and you and stuff you want even ...
Find the Longest Substring Containing Vowels in Even Counts
minimum-remove-to-make-valid-parentheses
Given the string `s`, return the size of the longest substring containing each vowel an even number of times. That is, 'a', 'e', 'i', 'o', and 'u' must appear an even number of times. **Example 1:** **Input:** s = "eleetminicoworoep " **Output:** 13 **Explanation:** The longest substring is "leetminicowor " which c...
Each prefix of a balanced parentheses has a number of open parentheses greater or equal than closed parentheses, similar idea with each suffix. Check the array from left to right, remove characters that do not meet the property mentioned above, same idea in backward way.
String,Stack
Medium
2095,2221
784
Hello everyone welcome today breaking bad luck this letter this competition and questions withdraw from every individual and subscribe for more ko blind aur toothless yo honey dr hain to FD sensitive yantra in witch karte hain aur lower caste lines of kindness and need to Have Tried To Convert Tweet Seervi Word Origin ...
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
835
hey guys welcome back to another video and today we're going to be solving the leeco question image overlap alright so in this question we're given two images a and b and these images are represented in binary square matrices of the same size so the size of a is the same size of b and binary just means that it's only z...
Image Overlap
linked-list-components
You are given two images, `img1` and `img2`, represented as binary, square matrices of size `n x n`. A binary matrix has only `0`s and `1`s as values. We **translate** one image however we choose by sliding all the `1` bits left, right, up, and/or down any number of units. We then place it on top of the other image. W...
null
Hash Table,Linked List
Medium
2299
1,382
hello guys welcome back to Tech dose and in this video we will see balance a binary search tree problem which is from lead code number 1382 and a prerequisite before watching this video is to watch my video on check if a given binary tree is a BST so the link for this video will be in the description below you can go t...
Balance a Binary Search Tree
balance-a-binary-search-tree
Given the `root` of a binary search tree, return _a **balanced** binary search tree with the same node values_. If there is more than one answer, return **any of them**. A binary search tree is **balanced** if the depth of the two subtrees of every node never differs by more than `1`. **Example 1:** **Input:** root ...
null
null
Medium
null
521
foreign welcome back to my channel and today we are going to solve a new lead code question that is longest and common subsequence one the question says given to string a and b return the length of the longest and common subsequence between A and B if the longest uncommon subsequent does not exist return -1 and subsequ...
Longest Uncommon Subsequence I
longest-uncommon-subsequence-i
Given two strings `a` and `b`, return _the length of the **longest uncommon subsequence** between_ `a` _and_ `b`. If the longest uncommon subsequence does not exist, return `-1`. An **uncommon subsequence** between two strings is a string that is a **subsequence of one but not the other**. A **subsequence** of a stri...
null
String
Easy
522
168
Hello everyone, welcome to my channel, this is an easy question but very famous. It has not been asked by me. This has also been asked once in the company phone interview. Excel seat pen title. The name of the question is IT has not been asked by me. Microsoft and benefits and this Let's look at the question, it is a s...
Excel Sheet Column Title
excel-sheet-column-title
Given an integer `columnNumber`, return _its corresponding column title as it appears in an Excel sheet_. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... **Example 1:** **Input:** columnNumber = 1 **Output:** "A " **Example 2:** **Input:** columnNumber = 28 **Output:** "AB " **Example 3:**...
null
Math,String
Easy
171,2304
341
Hello Guys I Am Lalit Agarwal Welcomes You All On Your Own Coding Channel Code Face Made By You Made For You So Let's Start Now Today's Lead Code Problem Aaj Ki Lead Code Ki Problem Kya Bol Rahi Hai Achcha Before Moving Towards The Problem Na One Minute Session For those who have understood this problem well and who wa...
Flatten Nested List Iterator
flatten-nested-list-iterator
You are given a nested list of integers `nestedList`. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator to flatten it. Implement the `NestedIterator` class: * `NestedIterator(List nestedList)` Initializes the iterator with the nested list `nestedLi...
null
Stack,Tree,Depth-First Search,Design,Queue,Iterator
Medium
251,281,385,565
735
Ajay ko a firewall welcome to line repeat step exactly date 28th October write charge religion ho to problems acid calibration difficult problems were given are sports officer representing a strong for each sexual positive and negative left subscribe to find the state of the states After All Relationships Tip Posters M...
Asteroid Collision
asteroid-collision
We are given an array `asteroids` of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed. Find out the state of the asteroids after all collisio...
Say a row of asteroids is stable. What happens when a new asteroid is added on the right?
Array,Stack
Medium
605,2245,2317
137
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 single number two so in this question we given an integer array called nums where every element appears three times except one and that element appears only once we have to return the single element as ...
Single Number II
single-number-ii
Given an integer array `nums` where every element appears **three times** except for one, which appears **exactly once**. _Find the single element and return it_. You must implement a solution with a linear runtime complexity and use only constant extra space. **Example 1:** **Input:** nums = \[2,2,3,2\] **Output:**...
null
Array,Bit Manipulation
Medium
136,260
387
Hello hello friends in addition to withdraw into a discussion see list to problem solve tunic character in string give one of the simplest portion mostly used in the elephant according to screen in grams you will gain benefits from already tourism find the first not repeating character industry and return Index Back Pi...
First Unique Character in a String
first-unique-character-in-a-string
Given a string `s`, _find the first non-repeating character in it and return its index_. If it does not exist, return `-1`. **Example 1:** **Input:** s = "leetcode" **Output:** 0 **Example 2:** **Input:** s = "loveleetcode" **Output:** 2 **Example 3:** **Input:** s = "aabb" **Output:** -1 **Constraints:** * `...
null
Hash Table,String,Queue,Counting
Easy
451
1,290
We are preparing for the charity show, but at the same time, if you have some good impressive resume in your resume, then your chances of getting shortlisted in the show increases a lot. Okay, so anything development schemes like this platform code me. Reaching the office, this video, where very good programs are avail...
Convert Binary Number in a Linked List to Integer
make-array-strictly-increasing
Given `head` which is a reference node to a singly-linked list. The value of each node in the linked list is either `0` or `1`. The linked list holds the binary representation of a number. Return the _decimal value_ of the number in the linked list. The **most significant bit** is at the head of the linked list. **E...
Use dynamic programming. The state would be the index in arr1 and the index of the previous element in arr2 after sorting it and removing duplicates.
Array,Binary Search,Dynamic Programming
Hard
null
1,749
hello look for another lyrical problem today we are going to try 1749 maximum absolute sum of any supper range so Subaru is a continuous array yeah from the nouns for example 203 are subarues and two and three are continuous yeah because from here we know that nums L plus 1 and the numbers are minus one yeah we know th...
Maximum Absolute Sum of Any Subarray
sellers-with-no-sales
You are given an integer array `nums`. The **absolute sum** of a subarray `[numsl, numsl+1, ..., numsr-1, numsr]` is `abs(numsl + numsl+1 + ... + numsr-1 + numsr)`. Return _the **maximum** absolute sum of any **(possibly empty)** subarray of_ `nums`. Note that `abs(x)` is defined as follows: * If `x` is a negative...
null
Database
Easy
1724
819
hello welcome to my channel again i'm here to do my angelico challenge today we have litko 819 most common word just like what he said it's most common word so now the input in here will be a string we're looking for the most common word in here except the band word so we take out the bandword so hit had appeared three...
Most Common Word
minimum-swaps-to-make-sequences-increasing
Given a string `paragraph` and a string array of the banned words `banned`, return _the most frequent word that is not banned_. It is **guaranteed** there is **at least one word** that is not banned, and that the answer is **unique**. The words in `paragraph` are **case-insensitive** and the answer should be returned ...
null
Array,Dynamic Programming
Hard
2234
152
Hai Voltage Ki Bhi Talking About Lootkhor Problem Maximum Product Savere Profits Test Cases Name Find Content Class Ninth Is Illegal Business Verdict Product Do Subscribe The Supreme Sacrifice Me To Find The Maximum Product Savere Bhatkti Complete Sharing Your Voter Products 35.23 - 26 - - - - Sharing Your Voter Produc...
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
385
Well, I'm going to do problem number 385 of the it code that doesn't bother me even because it's your program that is marked as medium. I think it's a lot of work to do it, that is, because with this one it's recursion and seriously I get this one but it's Quite complex and confusing test, they will get better, it is c...
Mini Parser
mini-parser
Given a string s represents the serialization of a nested list, implement a parser to deserialize it and return _the deserialized_ `NestedInteger`. Each element is either an integer or a list whose elements may also be integers or other lists. **Example 1:** **Input:** s = "324 " **Output:** 324 **Explanation:** Yo...
null
String,Stack,Depth-First Search
Medium
341,439,722
133
today we are going to solve clone graph we are given an undirected graph and we need to return the deep copy of the graph so what does the deep copy mean deep copy means that we are going to return a new graph which is will be exact same copy means it is containing same number of nodes and similar kind of edges everyth...
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
1,519
hey everybody this is Larry this is problem 2 on the recent contest it like went into subscriber enjoyment it is called number of nodes in the subtree with the same neighbor so basically for this problem I just said of recursively I used counters to go do the count you can maybe get away with just using it away or some...
Number of Nodes in the Sub-Tree With the Same Label
minimum-subsequence-in-non-increasing-order
You are given a tree (i.e. a connected, undirected graph that has no cycles) consisting of `n` nodes numbered from `0` to `n - 1` and exactly `n - 1` `edges`. The **root** of the tree is the node `0`, and each node of the tree has **a label** which is a lower-case character given in the string `labels` (i.e. The node w...
Sort elements and take each element from the largest until accomplish the conditions.
Array,Greedy,Sorting
Easy
2316
742
Hello Hi Friends Welcome Back Today We Are Going To Solve Its Problems Shift Or Project But 350 Will Look Into The Problem Description And Samay Examples And Solution For This Problem Is Just Want To Mention Back To My Channel Is Dedicated To Help People Who Are Preparing For Code in Interviews and Java Interviews and ...
Closest Leaf in a Binary Tree
to-lower-case
Given the `root` of a binary tree where every node has **a unique value** and a target integer `k`, return _the value of the **nearest leaf node** to the target_ `k` _in the tree_. **Nearest to a leaf** means the least number of edges traveled on the binary tree to reach any leaf of the tree. Also, a node is called a ...
Most languages support lowercase conversion for a string data type. However, that is certainly not the purpose of the problem. Think about how the implementation of the lowercase function call can be done easily. Think ASCII! Think about the different capital letters and their ASCII codes and how that relates to their ...
String
Easy
2235
393
so here we are hello and welcome hello howdy today just give it a moment see yeah all right there we go sweet um yeah so i wanted to i'm gonna go see a friend later today and it's gonna be great and um i want to work on a problem before we go within the hour of time i have before seeing that person so we'll do that um ...
UTF-8 Validation
utf-8-validation
Given an integer array `data` representing the data, return whether it is a valid **UTF-8** encoding (i.e. it translates to a sequence of valid UTF-8 encoded characters). A character in **UTF8** can be from **1 to 4 bytes** long, subjected to the following rules: 1. For a **1-byte** character, the first bit is a `0`...
All you have to do is follow the rules. For a given integer, obtain its binary representation in the string form and work with the rules given in the problem. An integer can either represent the start of a UTF-8 character, or a part of an existing UTF-8 character. There are two separate rules for these two scenarios in...
Array,Bit Manipulation
Medium
null