- 26
- 20 778
Lulu Code
United States
เข้าร่วมเมื่อ 21 เม.ย. 2023
Share LeetCode and HackerRank solutions.
[ LeetCode 87 ] Subsets | Bit Manipulation | Python | Complexity explained | Code
#datastructures #algorithm #leetcode #interview #bitmanipulation #python
00:00 problem description
04:09 why bit manipulation
12:35 time/space complexity
15:03 coding
00:00 problem description
04:09 why bit manipulation
12:35 time/space complexity
15:03 coding
มุมมอง: 109
วีดีโอ
[ LeetCode 2642 ] Design Graph With Shortest Path Calculator | Floyd-Warshall | Python
มุมมอง 39ปีที่แล้ว
Floyd-Warshall tutorial: th-cam.com/video/4NQ3HnhyNfQ/w-d-xo.htmlsi=tg1IMQSTCho1J7tS th-cam.com/video/oNI0rf2P9gE/w-d-xo.htmlsi=gdHd7pnv6Vyt3lmV #leetcode #datastructures #python
[ LeetCode 2355 ] Maximum Number of Books You Can Take | Python | DP | Stack | 中文 | 視覺化解釋
มุมมอง 578ปีที่แล้ว
This is the coding part. For concept explaining, please check: th-cam.com/video/boe9G1JdF6w/w-d-xo.html
[ LeetCode 2355 ] Maximum Number of Books You Can Take | DP | Stack | 中文 | 視覺化解釋
มุมมอง 242ปีที่แล้ว
00:18 Observation 10:10 Dynamic Programming 18:55 Stack Coding part: th-cam.com/video/HMuLukKD4pY/w-d-xo.html #leetcode #datastructures #codinginterview #dynamicprogramming #stack
[ LeetCode 779 ] K-th Symbol In Grammar | Recursion | Binary Tree | Python
มุมมอง 36ปีที่แล้ว
03:18 Optimal Solution Explained 11:35 Coding #datastructures #python #recursion #binarytree
[ LeetCode 2251 ] Number Of Flowers In Full Bloom
มุมมอง 88ปีที่แล้ว
#datastructures #algorithm #leetcode #python 00:14 Problem Description 03:38 Explain 14:28 Coding
[ LeetCode 847 ] Shortest Path Visiting All Nodes | Python | BFS | Graph
มุมมอง 39ปีที่แล้ว
#datastructures #leetcode #python #graph #bfs
[ LeetCode 2104 ] Sum of Subarray Ranges | Coding | Python
มุมมอง 471ปีที่แล้ว
#leetcode #datastructures #stack #python #coding This video only contains the code. The previous video explains the logic: th-cam.com/video/pe-G2-RbFOk/w-d-xo.html
[ HackerRank ] Recursive Digit Sum | Java | char caculation
มุมมอง 197ปีที่แล้ว
#datastructures #hackerrank #java
[ HackerRank ] Fraudulent Activity Notifications | Counting sort | Find Median | Java
มุมมอง 499ปีที่แล้ว
#datastructures #leetcode #java #countingsort #complexity #hackerrank #hackerranksolutions 00:00 Problem Description 02:35 Explain Algo 03:54 Finding Median By Counting Sort 11:05 Coding
[ HackerRank ] LegoBlocks | Dynamic Programming | Python | Visual Explanation
มุมมอง 9Kปีที่แล้ว
#leetcode #hacker #datastructures #python #dynamogaming 00:00 Question Description 02:09 Explanation 17:17 Working Example 21:43 Coding
[ LeetCode 606 ] Construct String from Binary Tree | Stack | Complexity Explained | Python
มุมมอง 69ปีที่แล้ว
#leetcode #datastructures #python #stack #tree #binarytree 00:00 Problem Description 05:17 Preorder Traversal Using Stack Review 08:50 Adding Parenthesis 18:45 Coding
[ LeetCode 1326 ] Minimum Number of Taps to Open to Water a Garden | Greedy | Python
มุมมอง 54ปีที่แล้ว
#leetcode #python #datastructures #greedy 00:01 Greedy Algo 08:45 Dry walk 16:44 Coding
[ LeetCode 120 ] Triangle | Bottomu-Up DP | Recursion | Memoization | Complexity Explained | Python
มุมมอง 76ปีที่แล้ว
01:06 Recursion Memoization 03:06 Recursion Coding 05:50 Complexity Explained 08:03 Bottom Up DP 13:03 Bottom Up DP Coding #leetcode #datastructures #recursion #dynamogaming #complexity #python
[ LeetCode 289 ] Game of Life | Java | Bit | In-place update
มุมมอง 98ปีที่แล้ว
[ LeetCode 289 ] Game of Life | Java | Bit | In-place update
[ LeetCode 399 ] Evaluate Division | Union Find | Python
มุมมอง 310ปีที่แล้ว
[ LeetCode 399 ] Evaluate Division | Union Find | Python
[ LeetCode 1130 ] Minimum Cost Tree From Leaf Values || DP || Python
มุมมอง 602ปีที่แล้ว
[ LeetCode 1130 ] Minimum Cost Tree From Leaf Values || DP || Python
[ LeetCode 862 ] Shortest Subarray with Sum at Least K | deque | python
มุมมอง 111ปีที่แล้ว
[ LeetCode 862 ] Shortest Subarray with Sum at Least K | deque | python
[ LeetCode 2104 ] Sum of Subarray Ranges | Monotonic Stack
มุมมอง 7Kปีที่แล้ว
[ LeetCode 2104 ] Sum of Subarray Ranges | Monotonic Stack
[ LeetCode 1857 ] Largest Color Value in Directed Graph | DFS + Memoization
มุมมอง 23ปีที่แล้ว
[ LeetCode 1857 ] Largest Color Value in Directed Graph | DFS Memoization
[LeetCode 2345 ] Finding the number of visible mountains | One pass Argo
มุมมอง 656ปีที่แล้ว
[LeetCode 2345 ] Finding the number of visible mountains | One pass Argo
[ LeetCode 1319 ] Number of Operations to Make Network Connected | DFS | Explain in diagram
มุมมอง 65ปีที่แล้ว
[ LeetCode 1319 ] Number of Operations to Make Network Connected | DFS | Explain in diagram
[ LeetCode 862 ] [ Chinese ] Shortest Subarray with Sum at Least K | starts from n square to linear
มุมมอง 44ปีที่แล้ว
[ LeetCode 862 ] [ Chinese ] Shortest Subarray with Sum at Least K | starts from n square to linear
[ Leetcode 1888 ] [ Chinese ] Minimum Number of Flips to Make the Binary String Alternating
มุมมอง 56ปีที่แล้ว
[ Leetcode 1888 ] [ Chinese ] Minimum Number of Flips to Make the Binary String Alternating
why we are doing modulo for all element of the array and not only the last element?
This talk is the best, because you spend most of the time on the math. For so many of us, coding is easy and combinatorics is hard, yet this is the only talk I found that explains the math. Thank you so much.
Thank you This was good explanation
thanks I finally understand
f[0] is 1 which means there is only one way to build fp[0]: "no block". Thus you can just manually caculate f[0]~f[3] and f[4]=f[0]+f[1]+f[2]+f[3]=8
helper直接//2就好了 谢谢 代码很清楚
Great explanation, helped me understand this difficult problem. Thanks for the effort you put into this video.
Finally someone who describes the algorithm behind the solution. This is very well done.
python3 class Solution: def visibleMountains(self, peaks: List[List[int]]) -> int: # sort peaks in ascending order of (x - y) x-intercept # and also in descending order of (x + y) x-intercept peaks.sort(key=lambda x: ((x[0] - x[1]), -(x[0] + x[1]))) count = 0 max_end = float('-inf') for i, (x, y) in enumerate(peaks): if x + y > max_end: max_end = x + y if i < len(peaks) - 1 and peaks[i] == peaks[i + 1]: continue count += 1 return count
感谢分享,很清晰易懂的解释!
Lulu did you come up with this solution independently? Such a genius
No, I did reference to the official solution in Hackerrank. Yet, still needs lots of effort from my side to really understand the solution.
Hey Lulu, thanks for the explain. I didnt get why we are recursing the *width - the width* of each blocks in minute 7:36
In the first step when calculating the number of ways you can build a single wall layer of length 6, why do we add the four previous ones? I don't understnad that part
Awesome solution and eloborated explanation, thanks for clarifying this problem!
Thank you very much, I was stucked
many thanks for your video
Thank you so much for this explanation. It really helped.
Very gorgeous and lucid! Thanks for saving time!
Awesome explanation Lulu!
Thank you! 😃
im confused about this "counter" variable. at 6:48 the median is 4 not 3.
In the first 5 elements, the sorted window is = [2, 2, 3, 3, 4], so the median is the 3rd element (num3). And for the counter, the counter is the sum of frequency (cdf) up to the median number. For example, there are 2 of 2, 2 of 3, 1 of 4, so the sum of frequency up to 3rd element (cdf) is 2 + 2 = 4, and the median number is 3.
Thank you. May you be blessed. I wanted logical help and it was the best resource. Rest of the internet had code.
Glad it helped!
好欢乐,还有bgm
good
Thanks
Great explanation: well-structured, concise, with a practical walkthrough. Many thanks!
You're very welcome!
omg you actually taught me😂, thanks a lot
Happy to help!
great explanation. Thanks a lot. This is a harder question.
Nice
Thanks
nice coding keep it up ,)
Thanks!
To those who are wondering: We counted (1, 3) combo as 4 but (3, 1) as 1 cuz if we break 3 in (3, 1) it will break into (1, 2, 1) and (2, 1, 1) which can already be covered by previous considerations from (2, 2) and (1, 3) so to avoid overlapping it has been done so.
Imo your comment is misleading from the pattern of thought in the video. When making 4, it is true that: 2,2 breaks to 112, 211, 1111 (which would be 4 possibilites) and 3,1 breaks to 211, 121, 1111 (which would also be 4 possibilities) but in the explanation she didn't go through all the possible breaks, since she said we keep the first block in tact, and only look for possibilites with the rest of the blocks. You can see she marks the part that needs to be broken down with small diagonal lines. if the first block is a 1, we have 3, 21, 21 and 111, which is 4 possibilities if the first block is a 3, we only have 1 option left for the second block: 1. Thats why it is only 1 there.
You did a great job explaining the intuition on this one thank you!
Glad you enjoyed it!
Great explanation! thank you so much!!
Glad you enjoyed it!
Brute force solution : #assume the widest base and tallest mountain max_x = input[0][0] max_y = input[0][1] #calculate the widest base and tallest mountain for i in input: left_base = i[0]-i[1] right_base = i[0]+i[1] max_x = max(max_x, left_base) max_y = max(max_y, i[1]) #generate a 2D map of the scenery scenery = [[0 for i in range(max_y+1)] for j in range(-1*max_x, max_x + 1)] #populate the overlapping mountains for i in input: scenery[i[0]][i[1]] += 1 temp_y = i[1] - 1 counter = 1 while (temp_y > 0): for j in range(counter): scenery[i[0]-j][temp_y] += 1 scenery[i[0]+j][temp_y] += 1 counter += 1 temp_y -= 1 #Find the peaks which are not overlapped visible_mountain = 0 for i in input: if scenery[i[0]][i[1]] == 1: visible_mountain += 1 print(visible_mountain)
Thanks for the solution, Lulu! Could you please explain why is the total of ways to have a split in the wall is a multiplication of number of ways to build left-i and right-i?
You can draw on a paper with hight = 1 and width of 4. When the i == 2, left side has 2 ways and right side also 2 ways, so the total is 2 *2.
Hi, Lulu. Greetings from Lulu.
Hello!
The explanation was quite good, but it could have been even better with the code
Thanks for the suggestion. Since so many people asking for the coding part, I'll upload a new video for coding recently.
I am trying to solve this problem right now. Your video came in the right moment. Thank you so much.
Glad it helped
well explained thanks
28:11 total = 0,1,8,32(should be 64)
Thanks for the correction.
Thanks for your nice explanation! <3
My pleasure!
Great Explanation, Thanks Keep it Up
Thanks for liking
Explanation was good but it would be more helpful if you explain the code too, Btw keep up the good work. 🙌🙌
Ok next time
if this is ur original voice then let me say your voice is very cute
Thanks.
simping ho rhi bahut bhyankar
@@shashankshekhar8186 🤣🤣🤣🤣
bro ...hahahaha@@shashankshekhar8186
Thanks
Thanks!