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,769
hey what's up it is wednesday may 4th 2022. uh we are powering into may still in the beginning and yeah we are uh here at coding with chef or chef the algo man i still haven't decided the name of this channel and uh we're trying to um yeah solve some algo questions and uh so if you like my content just a reminder befor...
Minimum Number of Operations to Move All Balls to Each Box
get-maximum-in-generated-array
You have `n` boxes. You are given a binary string `boxes` of length `n`, where `boxes[i]` is `'0'` if the `ith` box is **empty**, and `'1'` if it contains **one** ball. In one operation, you can move **one** ball from a box to an adjacent box. Box `i` is adjacent to box `j` if `abs(i - j) == 1`. Note that after doing ...
Try generating the array. Make sure not to fall in the base case of 0.
Array,Dynamic Programming,Simulation
Easy
null
12
A height competition song in reality problem-solving serious problem it problem-solving serious problem it problem-solving serious problem it well and research institute romantic words updated with scientific expert video those problems absolutely solid to problem measurement electronic media problem statement pass rom...
Integer to Roman
integer-to-roman
Roman numerals are represented by seven different symbols: `I`, `V`, `X`, `L`, `C`, `D` and `M`. **Symbol** **Value** I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, `2` is written as `II` in Roman numeral, just two one's adde...
null
Hash Table,Math,String
Medium
13,273
412
welcome to joystick this is joey and in this video we are going to solve a problem that i have taken from lead code the problem is fizzbuzz which we are going to solve using java without further ado let's take a look at its problem statement but before that if you are new to my channel and haven't subscribed it yet the...
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,189
hello everyone so today we're going to solve a random v code problem and to make it random i'm going to generate a random number from 1 to 1 5 6 9 is the one five six nine is the number of lead code problems that exist as of today we got the result one nine three so let's see what uh problem number one nine three is um...
Maximum Number of Balloons
encode-number
Given a string `text`, you want to use the characters of `text` to form as many instances of the word **"balloon "** as possible. You can use each character in `text` **at most once**. Return the maximum number of instances that can be formed. **Example 1:** **Input:** text = "nlaebolko " **Output:** 1 **Example 2...
Try to find the number of binary digits returned by the function. The pattern is to start counting from zero after determining the number of binary digits.
Math,String,Bit Manipulation
Medium
1070
724
hello programmers uh this is a little good problem 724 the problem name is find pivot indexes I am reading the statement of the problem in Array of integer number calculate the pivot index of the array or here you can see the what is Pivot index okay the previous index is the index where the all the numbers is strictly...
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
95
hey everybody this is 2nd of september leeco daily challenge hit the like button to subscribe and join me on discord let me know what you think i'm going to be doing this all month uh and probably a little bit longer um yeah let me know what you think um i usually solve it live so if it's a little bit slow just watch i...
Unique Binary Search Trees II
unique-binary-search-trees-ii
Given an integer `n`, return _all the structurally unique **BST'**s (binary search trees), which has exactly_ `n` _nodes of unique values from_ `1` _to_ `n`. Return the answer in **any order**. **Example 1:** **Input:** n = 3 **Output:** \[\[1,null,2,null,3\],\[1,null,3,2\],\[2,1,3\],\[3,1,null,null,2\],\[3,2,null,1\...
null
Dynamic Programming,Backtracking,Tree,Binary Search Tree,Binary Tree
Medium
96,241
350
Yes, hello, there are 2 of these. The problem to be solved today is Leeteuk 3, number 150, l Section 5, Tour Race Turan, and the problem is as follows. Two arrays are given and the problem of writing a function that calculates their intersection is given. It's almost a child, and this is the array element of the number...
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
746
foreign problem 746 being caused climbing stairs so we are giving an integer request as we can say this cost for 10 15 and 20 and where cost I is the cost of the ice step so this means if we step at this position it will take a cost of 10. and then we can jump here or we can jump to the next one it means we can jump to...
Min Cost Climbing Stairs
prefix-and-suffix-search
You are given an integer array `cost` where `cost[i]` is the cost of `ith` step on a staircase. Once you pay the cost, you can either climb one or two steps. You can either start from the step with index `0`, or the step with index `1`. Return _the minimum cost to reach the top of the floor_. **Example 1:** **Input...
For a word like "test", consider "#test", "t#test", "st#test", "est#test", "test#test". Then if we have a query like prefix = "te", suffix = "t", we can find it by searching for something we've inserted starting with "t#te".
String,Design,Trie
Hard
211
357
Hello everyone welcome back to my YouTube channel Dashrath will dip for next and account number will also be there like value means number 21 from 2010 to the earliest how many numbers were deleted in 1969 usage all three are under the control of Ravana means I am any one in this how many From number to video, today we...
Count Numbers with Unique Digits
count-numbers-with-unique-digits
Given an integer `n`, return the count of all numbers with unique digits, `x`, where `0 <= x < 10n`. **Example 1:** **Input:** n = 2 **Output:** 91 **Explanation:** The answer should be the total numbers in the range of 0 <= x < 100, excluding 11,22,33,44,55,66,77,88,99 **Example 2:** **Input:** n = 0 **Output:** 1...
A direct way is to use the backtracking approach. Backtracking should contains three states which are (the current number, number of steps to get that number and a bitmask which represent which number is marked as visited so far in the current number). Start with state (0,0,0) and count all valid number till we reach n...
Math,Dynamic Programming,Backtracking
Medium
null
129
hey everybody this is larry this is day three after october november whoops wow time just keeps flying by to the november league daily challenge hit the like button the subscribe button join me on discord especially if you like contest problems and the code problems and so forth and just you know hanging around with sm...
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
402
hey everybody this is larry this is day 18 of the february leco daddy challenge hit the like button hit the subscribe button join me on discord let me know what you think about this problem double checking that this time i'm recording the screen okay we're good here uh yeah uh so i am actually today in katahina hopeful...
Remove K Digits
remove-k-digits
Given string num representing a non-negative integer `num`, and an integer `k`, return _the smallest possible integer after removing_ `k` _digits from_ `num`. **Example 1:** **Input:** num = "1432219 ", k = 3 **Output:** "1219 " **Explanation:** Remove the three digits 4, 3, and 2 to form the new number 1219 which ...
null
String,Stack,Greedy,Monotonic Stack
Medium
321,738,1792,2305
1,870
Today we will do the question of 26th July which is a very good question, you will get to learn from it, now just stay till the end of the video and try to understand that this is a very good best question which Above we can solve many different types of questions. Okay, let's read the question. The question is Minimum...
Minimum Speed to Arrive on Time
minimum-speed-to-arrive-on-time
You are given a floating-point number `hour`, representing the amount of time you have to reach the office. To commute to the office, you must take `n` trains in sequential order. You are also given an integer array `dist` of length `n`, where `dist[i]` describes the distance (in kilometers) of the `ith` train ride. E...
null
null
Medium
null
901
Show More MP3 Video Song Hi Guys Saunf Ban Do List Question So what is the name of this question? The name of this question is Online Stocks Gain OK and in this we have one classes in that class the input will come price input will come to us this is its price Spain If there is a pan in Spain, then what do we do? Let u...
Online Stock Span
advantage-shuffle
Design an algorithm that collects daily price quotes for some stock and returns **the span** of that stock's price for the current day. The **span** of the stock's price in one day is the maximum number of consecutive days (starting from that day and going backward) for which the stock price was less than or equal to ...
null
Array,Greedy,Sorting
Medium
null
1,367
hi today i'm talking about lead code problem 1367 linked list in a binary tree so what this problem asks you to do it says you're going to be given a binary tree called root and a linked list called the head and what they want you to do is return true if all of the elements in your linked list occur in a downward path ...
Linked List in Binary Tree
maximum-height-by-stacking-cuboids
Given a binary tree `root` and a linked list with `head` as the first node. Return True if all the elements in the linked list starting from the `head` correspond to some _downward path_ connected in the binary tree otherwise return False. In this context downward path means a path that starts at some node and goes d...
Does the dynamic programming sound like the right algorithm after sorting? Let's say box1 can be placed on top of box2. No matter what orientation box2 is in, we can rotate box1 so that it can be placed on top. Why don't we orient everything such that height is the biggest?
Array,Dynamic Programming,Sorting
Hard
2123
1,437
Shocked by the longest Udayveer Gondi song this question of click and this depth all once and at least length ke debit the question thought it right to take it a little higher so here I click is ok and it has 90 ok now whatever must have gone in between the two Will happen or ca n't grow again then okay this is this se...
Check If All 1's Are at Least Length K Places Away
minimum-insertion-steps-to-make-a-string-palindrome
Given an binary array `nums` and an integer `k`, return `true` _if all_ `1`_'s are at least_ `k` _places away from each other, otherwise return_ `false`. **Example 1:** **Input:** nums = \[1,0,0,0,1,0,0,1\], k = 2 **Output:** true **Explanation:** Each of the 1s are at least 2 places away from each other. **Example ...
Is dynamic programming suitable for this problem ? If we know the longest palindromic sub-sequence is x and the length of the string is n then, what is the answer to this problem? It is n - x as we need n - x insertions to make the remaining characters also palindrome.
String,Dynamic Programming
Hard
1356
649
hey everyone welcome back and let's write some more neat code today so today let's solve the problem Dota 2 Senate which is an absolute essay of a problem I've never actually played this video game so let's go through this real quick because this is a really good question to use as an example for me to show you how you...
Dota2 Senate
dota2-senate
In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 senate consists of senators coming from two parties. Now the Senate wants to decide on a change in the Dota2 game. The voting for this change is a round-based procedure. In each round, each senator can exercise **one** of the two rights:...
null
String,Greedy,Queue
Medium
495
1,647
hey everyone welcome back and let's write some more neat code today so today let's solve the problem minimum deletions to make character frequencies unique so in this case the problem title is pretty self-explanatory we're given a is pretty self-explanatory we're given a is pretty self-explanatory we're given a string ...
Minimum Deletions to Make Character Frequencies Unique
can-convert-string-in-k-moves
A string `s` is called **good** if there are no two different characters in `s` that have the same **frequency**. Given a string `s`, return _the **minimum** number of characters you need to delete to make_ `s` _**good**._ The **frequency** of a character in a string is the number of times it appears in the string. F...
Observe that shifting a letter x times has the same effect of shifting the letter x + 26 times. You need to check whether k is large enough to cover all shifts with the same remainder after modulo 26.
Hash Table,String
Medium
null
252
hi guys this is nikash here as i promised i have started making the lead code solutions and other interview preparation videos again and before digging into today's lead code problems i just want to remind you that i have started a page by name techytux i have started a facebook and instagram page by name techytux so p...
Meeting Rooms
meeting-rooms
Given an array of meeting time `intervals` where `intervals[i] = [starti, endi]`, determine if a person could attend all meetings. **Example 1:** **Input:** intervals = \[\[0,30\],\[5,10\],\[15,20\]\] **Output:** false **Example 2:** **Input:** intervals = \[\[7,10\],\[2,4\]\] **Output:** true **Constraints:** * ...
null
Array,Sorting
Easy
56,253
1,629
hello friends in this video we will solve lead code problem number 1629 slowest key so the question says that we have given string keys pressed of length and pressed i represents the i iaf key pressed in the testing sequence and the show test list release time array we have given where release time is ith key was relea...
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
374
That aapke ajay ko hua hai Hello hello everyone welcome to new video in this video by going to discuss another problem from last 4 p.m. Key Problem problem from last 4 p.m. Key Problem problem from last 4 p.m. Key Problem Is Problem Barfi Se Zor Is Number Higher Oil And Related Problems Statement Problem Number Of Subs...
Guess Number Higher or Lower
guess-number-higher-or-lower
We are playing the Guess Game. The game is as follows: I pick a number from `1` to `n`. You have to guess which number I picked. Every time you guess wrong, I will tell you whether the number I picked is higher or lower than your guess. You call a pre-defined API `int guess(int num)`, which returns three possible re...
null
Binary Search,Interactive
Easy
278,375,658
1,770
hello everyone welcome to csl and i am nishant here let's solve the another lead code problem maximum score from performing multiplication operation by saying it seems it's so easy problem and we'll go inside then we will find out no it's not a little bit tricky and the first thing we should know when to use and how to...
Maximum Score from Performing Multiplication Operations
minimum-deletions-to-make-character-frequencies-unique
You are given two **0-indexed** integer arrays `nums` and `multipliers` of size `n` and `m` respectively, where `n >= m`. You begin with a score of `0`. You want to perform **exactly** `m` operations. On the `ith` operation (**0-indexed**) you will: * Choose one integer `x` from **either the start or the end** of t...
As we can only delete characters, if we have multiple characters having the same frequency, we must decrease all the frequencies of them, except one. Sort the alphabet characters by their frequencies non-increasingly. Iterate on the alphabet characters, keep decreasing the frequency of the current character until it re...
String,Greedy,Sorting
Medium
1355,2212
290
all right let's talk about the word pattern so you're giving pattern and the string s so finders s follow the same pattern so here's follow means uh full match so such that there's a direction between a letter in pattern and a non-empty word a letter in pattern and a non-empty word a letter in pattern and a non-empty w...
Word Pattern
word-pattern
Given a `pattern` and a string `s`, find if `s` follows the same pattern. Here **follow** means a full match, such that there is a bijection between a letter in `pattern` and a **non-empty** word in `s`. **Example 1:** **Input:** pattern = "abba ", s = "dog cat cat dog " **Output:** true **Example 2:** **Input:*...
null
Hash Table,String
Easy
205,291
10
hello my friends this is Alexander bmin and this is a new episode of my YouTube show lead code with me where we solve coding challenges Brew your morning coffee and let's get started and go ahead okay as ordinary let's start with the task definition so given an input string s and a pattern P Implement regular expressio...
Regular Expression Matching
regular-expression-matching
Given an input string `s` and a pattern `p`, implement regular expression matching with support for `'.'` and `'*'` where: * `'.'` Matches any single character.​​​​ * `'*'` Matches zero or more of the preceding element. The matching should cover the **entire** input string (not partial). **Example 1:** **Input:...
null
String,Dynamic Programming,Recursion
Hard
44
1,641
if making six figures is one of your dreams you gotta first solve count sorted vowel strings so you're given an integer n returned the number of strings of length n that consist only of vowels A E I O and U okay and our lexicographically sorted a string s is lexographically sorted if for all valid i s of I is the same ...
Count Sorted Vowel Strings
countries-you-can-safely-invest-in
Given an integer `n`, return _the number of strings of length_ `n` _that consist only of vowels (_`a`_,_ `e`_,_ `i`_,_ `o`_,_ `u`_) and are **lexicographically sorted**._ A string `s` is **lexicographically sorted** if for all valid `i`, `s[i]` is the same as or comes before `s[i+1]` in the alphabet. **Example 1:** ...
null
Database
Medium
615
485
what's up guys Nick white here techni coding stuff on torsion youtube it is very late by me and I'm about to go to bed but I was just looking for some problems for tomorrow and I saw this one and I was like I could do this in two minutes cuz it was super easy you know maybe if you're beginner you thought it might I don...
Max Consecutive Ones
max-consecutive-ones
Given a binary array `nums`, return _the maximum number of consecutive_ `1`_'s in the array_. **Example 1:** **Input:** nums = \[1,1,0,1,1,1\] **Output:** 3 **Explanation:** The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3. **Example 2:** **Input:** nums = ...
You need to think about two things as far as any window is concerned. One is the starting point for the window. How do you detect that a new window of 1s has started? The next part is detecting the ending point for this window. How do you detect the ending point for an existing window? If you figure these two things...
Array
Easy
487,1046,1542,1999
859
Hello friends welcome to code Sutra let's all lead code product number 859 buddy strings in this problem we are given two strings see though the problem is a very easy level problem it is necessary that we generate all the possible examples before even diving into the implementation part why because any string problem ...
Buddy Strings
design-circular-deque
Given two strings `s` and `goal`, return `true` _if you can swap two letters in_ `s` _so the result is equal to_ `goal`_, otherwise, return_ `false`_._ Swapping letters is defined as taking two indices `i` and `j` (0-indexed) such that `i != j` and swapping the characters at `s[i]` and `s[j]`. * For example, swappi...
null
Array,Linked List,Design,Queue
Medium
860,1767
391
hey everybody this is Larry I hit the like button hit the subscribe button let me know how you're doing this farm I'm gonna stop alive right about now Hayaku between 91 perfect rectangle given and axis aligned rectangle where n is greater than 0 determine if they're all together form exact cover of a rectangular area N...
Perfect Rectangle
perfect-rectangle
Given an array `rectangles` where `rectangles[i] = [xi, yi, ai, bi]` represents an axis-aligned rectangle. The bottom-left point of the rectangle is `(xi, yi)` and the top-right point of it is `(ai, bi)`. Return `true` _if all the rectangles together form an exact cover of a rectangular region_. **Example 1:** **Inp...
null
Array,Line Sweep
Hard
null
1,941
hey everyone today i'll be going over the code 1941. uh check if all characters have equal number of occurrences so really um just counting all the characters making sure that the counts are all equal so we get this test case here we can see that a has two uh b has two and c has two that's equal we get another test cas...
Check if All Characters Have Equal Number of Occurrences
minimum-number-of-operations-to-make-string-sorted
Given a string `s`, return `true` _if_ `s` _is a **good** string, or_ `false` _otherwise_. A string `s` is **good** if **all** the characters that appear in `s` have the **same** number of occurrences (i.e., the same frequency). **Example 1:** **Input:** s = "abacbc " **Output:** true **Explanation:** The character...
Note that the operations given describe getting the previous permutation of s To solve this problem you need to solve every suffix separately
Math,String,Combinatorics
Hard
null
234
Hello everyone my name is Rahul and today our lead code problem is paladal linklist so the values ​​given to us in the linklist are linklist so the values ​​given to us in the linklist are linklist so the values ​​given to us in the linklist are they in a palindrome form or not and we have to find out their values ​​le...
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
96
hey what's up guys this is Chung here again so and I want to talk about this 96 unique binary search trees problem it's a very classic problems as you can see it's got it have got they've got a lot of likes here I'm gonna give my own lights here yeah I think I kind of like this problem yeah so the difficulty its medium...
Unique Binary Search Trees
unique-binary-search-trees
Given an integer `n`, return _the number of structurally unique **BST'**s (binary search trees) which has exactly_ `n` _nodes of unique values from_ `1` _to_ `n`. **Example 1:** **Input:** n = 3 **Output:** 5 **Example 2:** **Input:** n = 1 **Output:** 1 **Constraints:** * `1 <= n <= 19`
null
Math,Dynamic Programming,Tree,Binary Search Tree,Binary Tree
Medium
95
1,925
Al so this question is Con Square some triple and then given the integer and you want to satisfy a square + b square you want to satisfy a square + b square you want to satisfy a square + b square = C square and you want to return how = C square and you want to return how = C square and you want to return how many numb...
Count Square Sum Triples
count-nice-pairs-in-an-array
A **square triple** `(a,b,c)` is a triple where `a`, `b`, and `c` are **integers** and `a2 + b2 = c2`. Given an integer `n`, return _the number of **square triples** such that_ `1 <= a, b, c <= n`. **Example 1:** **Input:** n = 5 **Output:** 2 **Explanation**: The square triples are (3,4,5) and (4,3,5). **Example 2...
The condition can be rearranged to (nums[i] - rev(nums[i])) == (nums[j] - rev(nums[j])). Transform each nums[i] into (nums[i] - rev(nums[i])). Then, count the number of (i, j) pairs that have equal values. Keep a map storing the frequencies of values that you have seen so far. For each i, check if nums[i] is in the map...
Array,Hash Table,Math,Counting
Medium
2129
594
Oh 594 longest home angeles harmonious subsequence subsequent man i can it's a mouthful day we define it Hamada man this spelling things to hum come on ears heart we define a harmonious away there's in a way where the difference between them at its maximum value and its minimum while you it's exactly one now give it an...
Longest Harmonious Subsequence
longest-harmonious-subsequence
We define a harmonious array as an array where the difference between its maximum value and its minimum value is **exactly** `1`. Given an integer array `nums`, return _the length of its longest harmonious subsequence among all its possible subsequences_. A **subsequence** of array is a sequence that can be derived f...
null
Array,Hash Table,Sorting
Easy
null
56
hello everyone welcome to sudokodus this is raveena and today we are going to look at lead code problem number 56 which is merging Towers let's start by looking at the sum here it says that given an array of intervals where intervals of I is start of I and end of I merge all the overlapping intervals and return any an ...
Merge Intervals
merge-intervals
Given an array of `intervals` where `intervals[i] = [starti, endi]`, merge all overlapping intervals, and return _an array of the non-overlapping intervals that cover all the intervals in the input_. **Example 1:** **Input:** intervals = \[\[1,3\],\[2,6\],\[8,10\],\[15,18\]\] **Output:** \[\[1,6\],\[8,10\],\[15,18\]\...
null
Array,Sorting
Medium
57,252,253,495,616,715,761,768,1028,2297,2319
1,090
all right let's talk about the largest value from label so you have a value and label array and you also have num ones and use limit so use limits actually determine how many items you can use in the send label and num one is like how many uh number one you want to use right so just for example um red rubber here so sy...
Largest Values From Labels
armstrong-number
There is a set of `n` items. You are given two integer arrays `values` and `labels` where the value and the label of the `ith` element are `values[i]` and `labels[i]` respectively. You are also given two integers `numWanted` and `useLimit`. Choose a subset `s` of the `n` elements such that: * The size of the subset...
Check if the given k-digit number equals the sum of the k-th power of it's digits. How to compute the sum of the k-th power of the digits of a number ? Can you divide the number into digits using division and modulus operations ? You can find the least significant digit of a number by taking it modulus 10. And you can ...
Math
Easy
null
215
everyone welcome back and let's write some more neat code today so today let's solve the problem kth largest element in an array so we're given an integer array numsend and integer k we want to return the kth largest element in the array by largest they mean largest in sorted order not the largest distinct element so w...
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
119
In this video, we will see another variation of Pascal's triangle in which if we are given a row index and we have to print that entire row of Pascal's triangle, then how we can do it efficiently. In the last video, we saw that if we have to print this entire row If we want to print the complete Pascal triangle then ho...
Pascal's Triangle II
pascals-triangle-ii
Given an integer `rowIndex`, return the `rowIndexth` (**0-indexed**) row of the **Pascal's triangle**. In **Pascal's triangle**, each number is the sum of the two numbers directly above it as shown: **Example 1:** **Input:** rowIndex = 3 **Output:** \[1,3,3,1\] **Example 2:** **Input:** rowIndex = 0 **Output:** \[...
null
Array,Dynamic Programming
Easy
118,2324
215
hello everyone welcome to sud Coda this is Ravina and today we are going to look at problem number 215 which is K largest element in an array now let's start by reading the problem statement it says that given an integer array nums and an integer K return the kth largest element in the array note that it is the kth lar...
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
539
we're going to look at a legal problem called minimum time difference so given a list of 24 hour clock time points which is in hour and minute format return the minimum minus difference between any two time points in the list so you can see here we have time points in a list of string right and then we want to return t...
Minimum Time Difference
minimum-time-difference
Given a list of 24-hour clock time points in **"HH:MM "** format, return _the minimum **minutes** difference between any two time-points in the list_. **Example 1:** **Input:** timePoints = \["23:59","00:00"\] **Output:** 1 **Example 2:** **Input:** timePoints = \["00:00","23:59","00:00"\] **Output:** 0 **Constrai...
null
Array,Math,String,Sorting
Medium
2266
1,431
hey everybody this is Larry with a shirt on it is April 17. uh hit the like button hit the Subscribe button join my Discord it looks like today is a easy palm so I'll probably try to do a premium problem just to kind of you know get my reps in a little bit today's problem is 1431 kids with the greatest number of candie...
Kids With the Greatest Number of Candies
all-ancestors-of-a-node-in-a-directed-acyclic-graph
There are `n` kids with candies. You are given an integer array `candies`, where each `candies[i]` represents the number of candies the `ith` kid has, and an integer `extraCandies`, denoting the number of extra candies that you have. Return _a boolean array_ `result` _of length_ `n`_, where_ `result[i]` _is_ `true` _i...
Consider how reversing each edge of the graph can help us. How can performing BFS/DFS on the reversed graph help us find the ancestors of every node?
Depth-First Search,Breadth-First Search,Graph,Topological Sort
Medium
1912
332
hey everybody this is Larry this is day 28 of the LICO daily challenge hit the like button to subscribe and joining this core channel let me know how you feel today we're gonna go but we construct our territory I'm so euro time we love this channel I'm actually trying something new where I changed the order of things b...
Reconstruct Itinerary
reconstruct-itinerary
You are given a list of airline `tickets` where `tickets[i] = [fromi, toi]` represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it. All of the tickets belong to a man who departs from `"JFK "`, thus, the itinerary must begin with `"JFK "`. If there are multiple...
null
Depth-First Search,Graph,Eulerian Circuit
Hard
2051,2201
296
hello and welcome to another video in this video we're going to be going over best meeting point which is the problem week for this week and in the problem you're given an M binary grid where one marks the home of one friend and you want to return the minimum total travel distance total D travel distance is a sum of th...
Best Meeting Point
best-meeting-point
Given an `m x n` binary grid `grid` where each `1` marks the home of one friend, return _the minimal **total travel distance**_. The **total travel distance** is the sum of the distances between the houses of the friends and the meeting point. The distance is calculated using [Manhattan Distance](http://en.wikipedia....
Try to solve it in one dimension first. How can this solution apply to the two dimension case?
Array,Math,Sorting,Matrix
Hard
317,462
1,710
hello everyone so today we will be solving maximum units on a truck which is day 14 of late code june challenge and the question goes like this you are assigned to put some amount of boxes onto one truck you are given 2d array box types where box types of i is the number of boxes of i and number of units per box is i s...
Maximum Units on a Truck
find-servers-that-handled-most-number-of-requests
You are assigned to put some amount of boxes onto **one truck**. You are given a 2D array `boxTypes`, where `boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]`: * `numberOfBoxesi` is the number of boxes of type `i`. * `numberOfUnitsPerBoxi` is the number of units in each box of the type `i`. You are also given...
To speed up the next available server search, keep track of the available servers in a sorted structure such as an ordered set. To determine if a server is available, keep track of the end times for each task in a heap and add the server to the available set once the soonest task ending time is less than or equal to th...
Array,Greedy,Heap (Priority Queue),Ordered Set
Hard
null
258
in this video I will show you how to solve with co2 challenge number 258 at digits so we are given unknown negative integer now we need to repeatedly add its digits until the result is only one digit so we can solve this problem recursively by adding digits and then adding digits of the resulting number but we can see ...
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
816
hey everybody this is larry this is me going over may 13th of the may league daily challenge hit the like button in the subscribe button join me on discord let me know what you think about today's prom ambitious or i mean ambiguous coordinates um yeah so you should stop this live so it's a little bit slow fast forward ...
Ambiguous Coordinates
design-hashset
We had some 2-dimensional coordinates, like `"(1, 3) "` or `"(2, 0.5) "`. Then, we removed all commas, decimal points, and spaces and ended up with the string s. * For example, `"(1, 3) "` becomes `s = "(13) "` and `"(2, 0.5) "` becomes `s = "(205) "`. Return _a list of strings representing all possibilities for wh...
null
Array,Hash Table,Linked List,Design,Hash Function
Easy
817,1337
270
hey guys how are you doing this is jaser who is not good at algorithms in this video i'm going to take a look at 270 closest binary surgery value given a non-empty binary search tree bst non-empty binary search tree bst non-empty binary search tree bst okay and a target value find the value in the bst that is closest t...
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
29
Hello Guys Welcome Gautam Miding subscribe and subscribe the Path of your Result Problem Appointed mid-december Loot Id Problem Appointed mid-december Loot Id Problem Appointed mid-december Loot Id Lesson Temple Now Let's Understand What Problem That Loot Vighn Subsidized Subscribe Button More Id Am Id Problem Thursday...
Divide Two Integers
divide-two-integers
Given two integers `dividend` and `divisor`, divide two integers **without** using multiplication, division, and mod operator. The integer division should truncate toward zero, which means losing its fractional part. For example, `8.345` would be truncated to `8`, and `-2.7335` would be truncated to `-2`. Return _the...
null
Math,Bit Manipulation
Medium
null
1,345
hey everybody this is larry this is day 15 of the leeco january daily challenge hit the like button hit the subscribe button join me on discord let me know what you think about today's farm jump game 4. there's so many of them i don't know which one this is apparently it's hard though so let's give it a try um yeah so ...
Jump Game IV
perform-string-shifts
Given an array of integers `arr`, you are initially positioned at the first index of the array. In one step you can jump from index `i` to index: * `i + 1` where: `i + 1 < arr.length`. * `i - 1` where: `i - 1 >= 0`. * `j` where: `arr[i] == arr[j]` and `i != j`. Return _the minimum number of steps_ to reach the...
Intuitively performing all shift operations is acceptable due to the constraints. You may notice that left shift cancels the right shift, so count the total left shift times (may be negative if the final result is right shift), and perform it once.
Array,Math,String
Easy
null
23
hello guys welcome to algorithms made easy today we will be discussing the question merge key sorted list in this question we are given an array of k linked list each linked list is sorted in ascending order we need to merge all the linked lists into one sorted linked list and return it in the first example we can see ...
Merge k Sorted Lists
merge-k-sorted-lists
You are given an array of `k` linked-lists `lists`, each linked-list is sorted in ascending order. _Merge all the linked-lists into one sorted linked-list and return it._ **Example 1:** **Input:** lists = \[\[1,4,5\],\[1,3,4\],\[2,6\]\] **Output:** \[1,1,2,3,4,4,5,6\] **Explanation:** The linked-lists are: \[ 1->4...
null
Linked List,Divide and Conquer,Heap (Priority Queue),Merge Sort
Hard
21,264
399
so the question as you can see on the screen is we have given these equations and corresponding values and we have to find the answer for these queries like here a to b it represent a divided by b uh and the value is 2.0 similarly b uh and the value is 2.0 similarly b uh and the value is 2.0 similarly b divided by c an...
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
203
all right this lead to a question is called removed linked list elements it says remove all elements from a linked list of integers that have value Val so the first example is a linked list 1 2 6 3 4 5 6 and Valis 6 so the output is that linked lists with any elements with the value of 6 removed so what we have at 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
34
Hello hello everyone welcome to my channel let's all the problem find the first and last position of element in solid as a very famous problem and this is my favorite problem of most everyday life is Google Microsoft and solve this problem of starting and position of India. - 110 time complexity of all times in hindi t...
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
345
okay sup guys leak code 345 reverse valves of a string given a string s reverse only all the vowels in the string and return it uh the vowels are a e i o u and they can appear in both lower and uppercases more than once so real simple I'm a good example here in hello we have two vowels H and or sorry E and O in this ca...
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
229
welcome back to another Le code video today we're going to be solving 229 majority elements medium given an enter your array of size and find all Ms elements that appear more than uh 1/3 time right than uh 1/3 time right than uh 1/3 time right so I mean if you haven't watched my last video you should go ahead and watch...
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,970
hey everyone welcome back today we are going to solve problem number 1970 last day where you can still cross first we'll see the explanation of the problem statement then Logic on the code now let's dive into the solution so in this problem we have a binary Matrix and we are given row and column of the binary Matrix an...
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
198
hey guys welcome back to the channel in our previous video we solved this problem legal 198 house rubber which is a very common big tech interview questions because it takes a bunch of tricks to make this work we had a really good solution which kind of made sense and we kind of explained it on paper too we explained h...
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
389
hey guys welcome back today we're going to be solving lead code 389 find the difference feel free to pause the video just to read through what the problem is asking for why find the examples more descriptive so given two strings s and c okay s is just a bunch of strings uh characters on the string and t is the same cha...
Find the Difference
find-the-difference
You are given two strings `s` and `t`. String `t` is generated by random shuffling string `s` and then add one more letter at a random position. Return the letter that was added to `t`. **Example 1:** **Input:** s = "abcd ", t = "abcde " **Output:** "e " **Explanation:** 'e' is the letter that was added. **Exam...
null
Hash Table,String,Bit Manipulation,Sorting
Easy
136
1,351
hi guys good morning welcome back to the new video again it's easy problem but the way to approach it the way to do it is something different and interesting so yeah um why not this problem uh so count negative numbers in a sorted a matrix so basically it's a short see Mark the word that is how you know that what optim...
Count Negative Numbers in a Sorted Matrix
replace-the-substring-for-balanced-string
Given a `m x n` matrix `grid` which is sorted in non-increasing order both row-wise and column-wise, return _the number of **negative** numbers in_ `grid`. **Example 1:** **Input:** grid = \[\[4,3,2,-1\],\[3,2,1,-1\],\[1,1,-1,-2\],\[-1,-1,-2,-3\]\] **Output:** 8 **Explanation:** There are 8 negatives number in the ma...
Use 2-pointers algorithm to make sure all amount of characters outside the 2 pointers are smaller or equal to n/4. That means you need to count the amount of each letter and make sure the amount is enough.
String,Sliding Window
Medium
null
329
hello and welcome back to the cracking fang youtube channel today we're going to be solving lead code problem 329 longest increasing path in a matrix given an m by n integers matrix return the length of the longest increasing path in matrix from each cell you can either move in four directions left right up or down you...
Longest Increasing Path in a Matrix
longest-increasing-path-in-a-matrix
Given an `m x n` integers `matrix`, return _the length of the longest increasing path in_ `matrix`. From each cell, you can either move in four directions: left, right, up, or down. You **may not** move **diagonally** or move **outside the boundary** (i.e., wrap-around is not allowed). **Example 1:** **Input:** matr...
null
Dynamic Programming,Depth-First Search,Breadth-First Search,Graph,Topological Sort,Memoization
Hard
null
1,295
hello so continue on this weekly contest 168 the first problem find the numbers with even number of digits so essentially the problem this is an easy one it says I'm given an array of integers when I return how many of them contain an even number of digits essentially how many of these numbers contain an even number of...
Find Numbers with Even Number of Digits
minimum-garden-perimeter-to-collect-enough-apples
Given an array `nums` of integers, return how many of them contain an **even number** of digits. **Example 1:** **Input:** nums = \[12,345,2,6,7896\] **Output:** 2 **Explanation:** 12 contains 2 digits (even number of digits). 345 contains 3 digits (odd number of digits). 2 contains 1 digit (odd number of digits)....
Find a formula for the number of apples inside a square with a side length L. Iterate over the possible lengths of the square until enough apples are collected.
Math,Binary Search
Medium
null
421
hello hi everyone welcome back to the channel so today in this video lecture continuing in the try series we'll be solving this problem maximums or of two numbers in an array so basically we're given an integer array Norms we have to return the maximum result of num's eyes or num's day where I and J lies between 0 and ...
Maximum XOR of Two Numbers in an Array
maximum-xor-of-two-numbers-in-an-array
Given an integer array `nums`, return _the maximum result of_ `nums[i] XOR nums[j]`, where `0 <= i <= j < n`. **Example 1:** **Input:** nums = \[3,10,5,25,2,8\] **Output:** 28 **Explanation:** The maximum result is 5 XOR 25 = 28. **Example 2:** **Input:** nums = \[14,70,53,83,49,91,36,80,92,51,66,70\] **Output:** 1...
null
Array,Hash Table,Bit Manipulation,Trie
Medium
1826
949
Hello hello everybody welcome to my channel today one after the monthly challenge and problem is the largest time for giving digits swift died yesterday problem share dividend August challenge problem time set in comment section the smallest 2000000 subscribe Indian history of time can be written in directions number O...
Largest Time for Given Digits
cat-and-mouse
Given an array `arr` of 4 digits, find the latest 24-hour time that can be made using each digit **exactly once**. 24-hour times are formatted as `"HH:MM "`, where `HH` is between `00` and `23`, and `MM` is between `00` and `59`. The earliest 24-hour time is `00:00`, and the latest is `23:59`. Return _the latest 24-h...
null
Math,Dynamic Programming,Breadth-First Search,Graph,Memoization,Game Theory
Hard
1727
1,209
Raipur will be good for premature ejaculation. We had asked this question on this track, what we used to do in it was that whatever classification adjustment was getting consecutive duplicates, Jio SIM character was found, I was deleting it, but this question is a little twisted. It has been done, okay, I will request ...
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
772
you're going to look at the u problem called basic calculator number three so this question has all the problems that we counter in basic calculator number one and two so you can see here for our string or for our expression we're going to have plus minus multiplication and divisions as well as we're also going to have...
Basic Calculator III
construct-quad-tree
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, `'+'`, `'-'`, `'*'`, `'/'` operators, and open `'('` and closing parentheses `')'`. The integer division should **truncate toward zero**. You may assume that the given expression is always v...
null
Array,Divide and Conquer,Tree,Matrix
Medium
null
46
in this video we will solve lead code problem number 46 it's called permutations and the task is here to print all the permutations of a given list not print but return a vector which consists of all the permutations of the input list for example here the input is 1 2 3 and we know that 6 permutations can exist since 3...
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
939
hey everybody this is Larry this is me doing extra prom on February 21st of um well 2024 whatever this year is uh let's do it let's uh let's find one we have't done yet and Alo and that's RNG it um hopefully the mic quality is a little bit better my apologies if uh last I didn't realize that the mic just kind of died b...
Minimum Area Rectangle
valid-permutations-for-di-sequence
You are given an array of points in the **X-Y** plane `points` where `points[i] = [xi, yi]`. Return _the minimum area of a rectangle formed from these points, with sides parallel to the X and Y axes_. If there is not any such rectangle, return `0`. **Example 1:** **Input:** points = \[\[1,1\],\[1,3\],\[3,1\],\[3,3\]...
null
Dynamic Programming
Hard
null
782
welcome to september's lee code challenge this problem is called transform to chessboard you are given an end times n binary grid board in each move you can swap any two rows with each other or any two columns with each other keep in mind it has to be the entire row or the entire column we turn the minimum number of mo...
Transform to Chessboard
jewels-and-stones
You are given an `n x n` binary grid `board`. In each move, you can swap any two rows with each other, or any two columns with each other. Return _the minimum number of moves to transform the board into a **chessboard board**_. If the task is impossible, return `-1`. A **chessboard board** is a board where no `0`'s a...
For each stone, check if it is a jewel.
Hash Table,String
Easy
null
3
hey guys welcome back to another video and today we're going to be solving the lead code question longest substring without repeating characters all right so in this question we're going to be given a strength s and we want to find the length of the longest substring without any repeating characters so the question its...
Longest Substring Without Repeating Characters
longest-substring-without-repeating-characters
Given a string `s`, find the length of the **longest** **substring** without repeating characters. **Example 1:** **Input:** s = "abcabcbb " **Output:** 3 **Explanation:** The answer is "abc ", with the length of 3. **Example 2:** **Input:** s = "bbbbb " **Output:** 1 **Explanation:** The answer is "b ", with t...
null
Hash Table,String,Sliding Window
Medium
159,340,1034,1813,2209
930
Everyone today is exactly following similar code structure elements are in the form of binary numbers like zero and one and along with this what happened to us and he today the length is anything but numbers tell me how many times how frequently or How many times such a morning has been generated in which the song of a...
Binary Subarrays With Sum
all-possible-full-binary-trees
Given a binary array `nums` and an integer `goal`, return _the number of non-empty **subarrays** with a sum_ `goal`. A **subarray** is a contiguous part of the array. **Example 1:** **Input:** nums = \[1,0,1,0,1\], goal = 2 **Output:** 4 **Explanation:** The 4 subarrays are bolded and underlined below: \[**1,0,1**,0...
null
Dynamic Programming,Tree,Recursion,Memoization,Binary Tree
Medium
null
168
hey everyone today we are going to serve the readable question Excel sheet from title so you are given integer Chrome number and return its corresponding column title as it appears in your Excel sheet for example a is 1 B is 2 c 3 and the Z is 26 after Z so Quantum title is a that is a 27 and the a b and the 28 okay so...
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
216
A Firewall Welcome To Loan Co Repeat FlashLight Co Problem Which Is The Date 12th September Changes Combinations We Third Point System Of Medicine Backtracking Solution And Will Discuss In Detail About Backtracking Processor Slow Cancer Problem Pure Problem Statement Find All Facebook Nominations Of K Numbers Adaptive ...
Combination Sum III
combination-sum-iii
Find all valid combinations of `k` numbers that sum up to `n` such that the following conditions are true: * Only numbers `1` through `9` are used. * Each number is used **at most once**. Return _a list of all possible valid combinations_. The list must not contain the same combination twice, and the combinations...
null
Array,Backtracking
Medium
39
110
hey everybody this is larry this is day 22 of delete code daily challenge hit the like button hit the subscribe button join me on discord let me know what you think about trace farm balance binary tree so i do solve and record these lives so if it's a little bit slow feel free to fast forward i go for my thought proces...
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
1,422
hello hi guys good morning welcome backi I hope that you guys are doing good maximum score after splitting a string it has been asked by Google not pretty much but yeah it has been by Google because the see it has been asked by Google only and only because of the variations of basically the follow-ups variations of bas...
Maximum Score After Splitting a String
divide-array-in-sets-of-k-consecutive-numbers
Given a string `s` of zeros and ones, _return the maximum score after splitting the string into two **non-empty** substrings_ (i.e. **left** substring and **right** substring). The score after splitting a string is the number of **zeros** in the **left** substring plus the number of **ones** in the **right** substring...
If the smallest number in the possible-to-split array is V, then numbers V+1, V+2, ... V+k-1 must contain there as well. You can iteratively find k sets and remove them from array until it becomes empty. Failure to do so would mean that array is unsplittable.
Array,Hash Table,Greedy,Sorting
Medium
659,2261
57
in this video we'll go over lead code question number 57 insert interval now if you haven't already I'd highly recommend you first watch my video on lead code number 56 merge intervals as it's a very similar problem the link is in the description so please go check that out okay now let's look at this problem you are g...
Insert Interval
insert-interval
You are given an array of non-overlapping intervals `intervals` where `intervals[i] = [starti, endi]` represent the start and the end of the `ith` interval and `intervals` is sorted in ascending order by `starti`. You are also given an interval `newInterval = [start, end]` that represents the start and end of another i...
null
Array
Medium
56,715
1,697
hello guys welcome back today we are going to understand the liquid question okay so today leader question we have given is uh 1697 as you can see right so this question is uh very important because this question has been asked in the thing and but Google has asked this question multiple times okay so let's continue to...
Checking Existence of Edge Length Limited Paths
strings-differ-by-one-character
An undirected graph of `n` nodes is defined by `edgeList`, where `edgeList[i] = [ui, vi, disi]` denotes an edge between nodes `ui` and `vi` with distance `disi`. Note that there may be **multiple** edges between two nodes. Given an array `queries`, where `queries[j] = [pj, qj, limitj]`, your task is to determine for e...
BruteForce, check all pairs and verify if they differ in one character. O(n^2 * m) where n is the number of words and m is the length of each string. O(m^2 * n), Use hashset, to insert all possible combinations adding a character "*". For example: If dict[i] = "abc", insert ("*bc", "a*c" and "ab*").
Hash Table,String,Rolling Hash,Hash Function
Medium
2256
344
Hello guys welcome back to take decision in this video you will see how to reverse swing swift code for to june challenge so let's not look at problem statement problems district governor of characters in the form of history and to reverse in tarzan subscribe i want to Request to implement and not the thing is nothing ...
Reverse String
reverse-string
Write a function that reverses a string. The input string is given as an array of characters `s`. You must do this by modifying the input array [in-place](https://en.wikipedia.org/wiki/In-place_algorithm) with `O(1)` extra memory. **Example 1:** **Input:** s = \["h","e","l","l","o"\] **Output:** \["o","l","l","e","h...
The entire logic for reversing a string is based on using the opposite directional two-pointer approach!
Two Pointers,String,Recursion
Easy
345,541
1,870
hello guys welcome back today we are going to understand to delete good question that we have today 1870 so this is the question that we are going to understand today right so this is the coming from the uh delete your question right so question is one eight seven zero minimum speed to arrive on the time so you are giv...
Minimum Speed to Arrive on Time
minimum-speed-to-arrive-on-time
You are given a floating-point number `hour`, representing the amount of time you have to reach the office. To commute to the office, you must take `n` trains in sequential order. You are also given an integer array `dist` of length `n`, where `dist[i]` describes the distance (in kilometers) of the `ith` train ride. E...
null
null
Medium
null
148
hey everyone welcome back and today we'll be doing another lead code problem 148 shortlist this is the medium one given the head of the link let's return the list after sorting it is in ascending order so this is just a sorting problem we'll be performing much sort in which we will just break down things to the this ve...
Sort List
sort-list
Given the `head` of a linked list, return _the list after sorting it in **ascending order**_. **Example 1:** **Input:** head = \[4,2,1,3\] **Output:** \[1,2,3,4\] **Example 2:** **Input:** head = \[-1,5,3,4,0\] **Output:** \[-1,0,3,4,5\] **Example 3:** **Input:** head = \[\] **Output:** \[\] **Constraints:** * ...
null
Linked List,Two Pointers,Divide and Conquer,Sorting,Merge Sort
Medium
21,75,147,1992
142
alright hello guys welcome to my channel today's problem is linked lists cycle 2 which is number 142 from the lick code okay let's get started first we're given the linked list to return the note where the cycle begins so if there's no cycle we have to return null to present a cycle in the given linked list we use an i...
Linked List Cycle II
linked-list-cycle-ii
Given the `head` of a linked list, return _the node where the cycle begins. If there is no cycle, return_ `null`. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the `next` pointer. Internally, `pos` is used to denote the index of the node that ta...
null
Hash Table,Linked List,Two Pointers
Medium
141,287
127
Hua Tha Vaikuntha Saal Problem No. 127 On Light To Today Khandhar Problem School Dress That Dr Ek Path Sahib Ali Bana The Most Popular Problems Only Khandhe This Very Frequently R10 Program Interview Some And Lord Of Companies Including Facebook Amazon The Latest Direct Questions Returned That Show In Body Problem Me A...
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
1,833
code number 1833 maximum ice cream bars uh the question says it's a sweltering summer day and a boy wants to buy some ice cream at the store they are in ice cream bars and you're giving an array cost of land of length and where the cost at each index is the price of that particular ice cream bar in coins okay the boy i...
Maximum Ice Cream Bars
find-the-highest-altitude
It is a sweltering summer day, and a boy wants to buy some ice cream bars. At the store, there are `n` ice cream bars. You are given an array `costs` of length `n`, where `costs[i]` is the price of the `ith` ice cream bar in coins. The boy initially has `coins` coins to spend, and he wants to buy as many ice cream bar...
Let's note that the altitude of an element is the sum of gains of all the elements behind it Getting the altitudes can be done by getting the prefix sum array of the given array
Array,Prefix Sum
Easy
null
188
Hello hello guys welcome back to test know this video also see the best time to buy and sell staff or problem which is best on memorization and state machine and how this process will be dynamic programming as display and all the three other video subscribe comment we video Song Topic For The Center Of The Problem Say ...
Best Time to Buy and Sell Stock IV
best-time-to-buy-and-sell-stock-iv
You are given an integer array `prices` where `prices[i]` is the price of a given stock on the `ith` day, and an integer `k`. Find the maximum profit you can achieve. You may complete at most `k` transactions: i.e. you may buy at most `k` times and sell at most `k` times. **Note:** You may not engage in multiple tran...
null
Array,Dynamic Programming
Hard
121,122,123
382
Hello everyone, welcome to my channel, but if you understand then it will not seem like a medium, it will seem easy, okay, we will make it with two approaches, Google asked this question and what is the input, okay, so we have given you a link, get random function, we will do that tomorrow. So you have to send a random...
Linked List Random Node
linked-list-random-node
Given a singly linked list, return a random node's value from the linked list. Each node must have the **same probability** of being chosen. Implement the `Solution` class: * `Solution(ListNode head)` Initializes the object with the head of the singly-linked list `head`. * `int getRandom()` Chooses a node randoml...
null
Linked List,Math,Reservoir Sampling,Randomized
Medium
398
503
hello everyone this is my next video today I am going to explain the code question number 503 next greater element 2. given and circular integer array Norms the next element of nums dot length minus 1 is nums of zero return that next the greater number for every element in numbers the next greater number of numbers X t...
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
201
hello guys today we're going to solve this L Cod question which is with wise and of numbers range and in this question we are given two integers left and right that represent the range between left and right written the between and of all the numbers in this range both this left and right are inclusive you know it is f...
Bitwise AND of Numbers Range
bitwise-and-of-numbers-range
Given two integers `left` and `right` that represent the range `[left, right]`, return _the bitwise AND of all numbers in this range, inclusive_. **Example 1:** **Input:** left = 5, right = 7 **Output:** 4 **Example 2:** **Input:** left = 0, right = 0 **Output:** 0 **Example 3:** **Input:** left = 1, right = 2147...
null
Bit Manipulation
Medium
null
966
welcome to march's leeco challenge today's problem is vowel spell checker given this word list we want to implement a spell checker that converts a query word into a correct word for a given query word the spell checker handles two categories of spelling mistakes capitalization if the query matches a word in the word l...
Vowel Spellchecker
binary-subarrays-with-sum
Given a `wordlist`, we want to implement a spellchecker that converts a query word into a correct word. For a given `query` word, the spell checker handles two categories of spelling mistakes: * Capitalization: If the query matches a word in the wordlist (**case-insensitive**), then the query word is returned with ...
null
Array,Hash Table,Sliding Window,Prefix Sum
Medium
null
35
in this video we'll go over lead code question number 35 search insert position given a sorted array of distinct integers called nums and a Target value we have to return the index of the Target in the array if it doesn't exist then we'll have to return the index that it would be at if it were inserted in order now the...
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
659
hey what's up guys John here again actually I want to talk about this like problem number 659 one more time because I think in my in the previously videos we introduced like a very brilliant idea which is the o n time if you guys didn't know about that solutions you can check the other ones basically for the other solu...
Split Array into Consecutive Subsequences
split-array-into-consecutive-subsequences
You are given an integer array `nums` that is **sorted in non-decreasing order**. Determine if it is possible to split `nums` into **one or more subsequences** such that **both** of the following conditions are true: * Each subsequence is a **consecutive increasing sequence** (i.e. each integer is **exactly one** m...
null
Array,Hash Table,Greedy,Heap (Priority Queue)
Medium
347,1422
952
hello guys welcome to algorithms made easy today we will go through the day 30 problem from august lead coding channel wherein we will discuss solution to the problem largest component size by common factor please like the video and if you are new don't forget to subscribe to our channel so that you never miss any upda...
Largest Component Size by Common Factor
word-subsets
You are given an integer array of unique positive integers `nums`. Consider the following graph: * There are `nums.length` nodes, labeled `nums[0]` to `nums[nums.length - 1]`, * There is an undirected edge between `nums[i]` and `nums[j]` if `nums[i]` and `nums[j]` share a common factor greater than `1`. Return _t...
null
Array,Hash Table,String
Medium
null
22
Ajay, then in this video we will see how to generate all balance payment, but we will go through the input output and problem that if someone asks, what input has been given to that output worker and after that we will see that this is a question in the school, how is the entry fee in this? How can we do this? This is ...
Generate Parentheses
generate-parentheses
Given `n` pairs of parentheses, write a function to _generate all combinations of well-formed parentheses_. **Example 1:** **Input:** n = 3 **Output:** \["((()))","(()())","(())()","()(())","()()()"\] **Example 2:** **Input:** n = 1 **Output:** \["()"\] **Constraints:** * `1 <= n <= 8`
null
String,Dynamic Programming,Backtracking
Medium
17,20,2221
334
hello there so today we are going to cover increasing triplet sequence we are given an input of integer array nums and we have to return if this array consists of a triplet subsequence if it is contains triplet subsequence then it's true otherwise it returns false so let's understand the problem statement with an examp...
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
209
hello and welcome to another Elite code problem today we're going to be doing the problem of the day for July 6th minimum size sub race zone so you're given a subarray or you're giving an array and you want to return the minimal length of a sub array whose sum is greater than or equal to the Target and if it doesn't ex...
Minimum Size Subarray Sum
minimum-size-subarray-sum
Given an array of positive integers `nums` and a positive integer `target`, return _the **minimal length** of a_ _subarray_ _whose sum is greater than or equal to_ `target`. If there is no such subarray, return `0` instead. **Example 1:** **Input:** target = 7, nums = \[2,3,1,2,4,3\] **Output:** 2 **Explanation:** Th...
null
Array,Binary Search,Sliding Window,Prefix Sum
Medium
76,325,718,1776,2211,2329
147
hey everybody this is larry this is day 15 midway through the december league daily challenge hit like running the subscriber and drama and discord let me know what you think about today's problem insertion sort list okay so given ahead of the okay let's just insert some short insertion sword wow why is that hard to sa...
Insertion Sort List
insertion-sort-list
Given the `head` of a singly linked list, sort the list using **insertion sort**, and return _the sorted list's head_. The steps of the **insertion sort** algorithm: 1. Insertion sort iterates, consuming one input element each repetition and growing a sorted output list. 2. At each iteration, insertion sort removes...
null
Linked List,Sorting
Medium
148,850
1,295
because let's over 12 and if I find numbers with even number of digits so given an array numbers of integers returned how many of them contain even number of digits and we have array of number of integers so if you look at number one so we had 12 345 2 6 7 8 9 6 able to check if each item in the array has an even numbe...
Find Numbers with Even Number of Digits
minimum-garden-perimeter-to-collect-enough-apples
Given an array `nums` of integers, return how many of them contain an **even number** of digits. **Example 1:** **Input:** nums = \[12,345,2,6,7896\] **Output:** 2 **Explanation:** 12 contains 2 digits (even number of digits). 345 contains 3 digits (odd number of digits). 2 contains 1 digit (odd number of digits)....
Find a formula for the number of apples inside a square with a side length L. Iterate over the possible lengths of the square until enough apples are collected.
Math,Binary Search
Medium
null
828
hey my name is casey and i'm going to explain how to do lead code 828 count unique characters of all sub strings of a given string so let's pretend that we're given this string xx lelouch l x what this question is really asking is for every character how many sub strings is each character unique in so for example let's...
Count Unique Characters of All Substrings of a Given String
chalkboard-xor-game
Let's define a function `countUniqueChars(s)` that returns the number of unique characters on `s`. * For example, calling `countUniqueChars(s)` if `s = "LEETCODE "` then `"L "`, `"T "`, `"C "`, `"O "`, `"D "` are the unique characters since they appear only once in `s`, therefore `countUniqueChars(s) = 5`. Given a ...
null
Array,Math,Bit Manipulation,Brainteaser,Game Theory
Hard
null
249
hello guys how are you doing uh so today we are going to solve um problem 249 which is group shifted strings so what we are going to do in this problem so there will be bunch of strings which will be given to us and then we have to group them so they share some common property what is that property so for example if yo...
Group Shifted Strings
group-shifted-strings
We can shift a string by shifting each of its letters to its successive letter. * For example, `"abc "` can be shifted to be `"bcd "`. We can keep shifting the string to form a sequence. * For example, we can keep shifting `"abc "` to form the sequence: `"abc " -> "bcd " -> ... -> "xyz "`. Given an array of str...
null
Array,Hash Table,String
Medium
49
14
Hello Hi Everyone Welcome To My Channel It's All Very Important Problem Longest River From This Problem Easy But It's Good Like This Problem Is Multiple Times Interview Ravan Subscribe Like This Problem Important Subscribe Now To Receive New Updates Your Being Like Subscribe Comment And Subscribe The Log in to subscrib...
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
791
hey guys welcome back to my channel and in today's video we are going to solve one more lead code question that is question number 791 custom sort string so this is a medium level question and this has been asked by these many companies and that is impressive so let's see what this question is all about so in this ques...
Custom Sort String
split-bst
You are given two strings order and s. All the characters of `order` are **unique** and were sorted in some custom order previously. Permute the characters of `s` so that they match the order that `order` was sorted. More specifically, if a character `x` occurs before a character `y` in `order`, then `x` should occur ...
Use recursion. If root.val <= V, you split root.right into two halves, then join it's left half back on root.right.
Tree,Binary Search Tree,Recursion,Binary Tree
Medium
450
1,774
hey what's up guys uh this is sean here so this time 1774 closest dessert cost um so for this one uh you give you would like to make a dessert and are preparing to buy some ingredients so you have an ice creams uh based flavors and you have types of toppings to choose from and so to make ice cream you need to use at ex...
Closest Dessert Cost
add-two-polynomials-represented-as-linked-lists
You would like to make dessert and are preparing to buy the ingredients. You have `n` ice cream base flavors and `m` types of toppings to choose from. You must follow these rules when making your dessert: * There must be **exactly one** ice cream base. * You can add **one or more** types of topping or have no topp...
Process both linked lists at the same time If the current power of the two heads is equal, add this power with the sum of the coefficients to the answer list. If one head has a larger power, add this power to the answer list and move only this head.
Linked List,Math,Two Pointers
Medium
2,21,445
462
Hello guys, if we do it then we will make an equal agreement on the minimum balance of the sheet. This is the question of which cash account will we do, what we have to do in this is that we have a career and I have a life and we have to modify it in such a way that whatever we have The head element of hair should be e...
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
737
hello guys now let's try to solve the sentence similarity to problem there's a statement given to sentence words one word to each represented as a ray of strings in the list of similar world's payers determining if two sentences are similar for example what when you go to great acting skills in the worst you find drama...
Sentence Similarity II
sentence-similarity-ii
We can represent a sentence as an array of words, for example, the sentence `"I am happy with leetcode "` can be represented as `arr = [ "I ", "am ",happy ", "with ", "leetcode "]`. Given two sentences `sentence1` and `sentence2` each represented as a string array and given an array of string pairs `similarPairs` wher...
Consider the graphs where each pair in "pairs" is an edge. Two words are similar if they are the same, or are in the same connected component of this graph.
Array,Hash Table,String,Depth-First Search,Breadth-First Search,Union Find
Medium
547,721,734