Lulu Code
Lulu Code
  • 26
  • 20 778

วีดีโอ

[ 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
[ Hackerrank ] Reverse Shuffle Merge | Stack | Linear O | Python
มุมมอง 285ปีที่แล้ว
15:39 Coding
[ 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
[ LeetCode 240 ] Search a 2D matrix 2
มุมมอง 22ปีที่แล้ว
[ LeetCode 240 ] Search a 2D matrix 2

ความคิดเห็น

  • @MayankGupta-fi1vb
    @MayankGupta-fi1vb 16 วันที่ผ่านมา

    why we are doing modulo for all element of the array and not only the last element?

  • @trav1m1m
    @trav1m1m 2 หลายเดือนก่อน

    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.

  • @andrewmagdy5470
    @andrewmagdy5470 6 หลายเดือนก่อน

    Thank you This was good explanation

  • @frustrated_stuti
    @frustrated_stuti 7 หลายเดือนก่อน

    thanks I finally understand

  • @catskytw
    @catskytw 7 หลายเดือนก่อน

    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

  • @DongmingShen-v9i
    @DongmingShen-v9i 7 หลายเดือนก่อน

    helper直接//2就好了 谢谢 代码很清楚

  • @juanghpx
    @juanghpx 8 หลายเดือนก่อน

    Great explanation, helped me understand this difficult problem. Thanks for the effort you put into this video.

  • @MartinSteinausErding
    @MartinSteinausErding 9 หลายเดือนก่อน

    Finally someone who describes the algorithm behind the solution. This is very well done.

  • @shivamshrey47
    @shivamshrey47 9 หลายเดือนก่อน

    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

  • @josh-997
    @josh-997 10 หลายเดือนก่อน

    感谢分享,很清晰易懂的解释!

  • @EstherLi-0509
    @EstherLi-0509 10 หลายเดือนก่อน

    Lulu did you come up with this solution independently? Such a genius

    • @CodeCode-pz6oo
      @CodeCode-pz6oo 10 หลายเดือนก่อน

      No, I did reference to the official solution in Hackerrank. Yet, still needs lots of effort from my side to really understand the solution.

  • @xavierk99
    @xavierk99 11 หลายเดือนก่อน

    Hey Lulu, thanks for the explain. I didnt get why we are recursing the *width - the width* of each blocks in minute 7:36

  • @t0ny360
    @t0ny360 11 หลายเดือนก่อน

    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

  • @xialei3219
    @xialei3219 11 หลายเดือนก่อน

    Awesome solution and eloborated explanation, thanks for clarifying this problem!

  • @juanc94128
    @juanc94128 11 หลายเดือนก่อน

    Thank you very much, I was stucked

  • @nguyenngoctuan7149
    @nguyenngoctuan7149 11 หลายเดือนก่อน

    many thanks for your video

  • @dongyoonkim1211
    @dongyoonkim1211 ปีที่แล้ว

    Thank you so much for this explanation. It really helped.

  • @Po-YuJuan
    @Po-YuJuan ปีที่แล้ว

    Very gorgeous and lucid! Thanks for saving time!

  • @rubikswiz
    @rubikswiz ปีที่แล้ว

    Awesome explanation Lulu!

  • @NSSMutableYoutubeChannel
    @NSSMutableYoutubeChannel ปีที่แล้ว

    im confused about this "counter" variable. at 6:48 the median is 4 not 3.

    • @CodeCode-pz6oo
      @CodeCode-pz6oo ปีที่แล้ว

      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.

  • @HaroonRashid72
    @HaroonRashid72 ปีที่แล้ว

    Thank you. May you be blessed. I wanted logical help and it was the best resource. Rest of the internet had code.

  • @jaylenzhang4198
    @jaylenzhang4198 ปีที่แล้ว

    好欢乐,还有bgm

  • @sezerozer382
    @sezerozer382 ปีที่แล้ว

    good

  • @TarasSlipets
    @TarasSlipets ปีที่แล้ว

    Great explanation: well-structured, concise, with a practical walkthrough. Many thanks!

  • @ethans2536
    @ethans2536 ปีที่แล้ว

    omg you actually taught me😂, thanks a lot

  • @pandukasenevirathna9593
    @pandukasenevirathna9593 ปีที่แล้ว

    great explanation. Thanks a lot. This is a harder question.

  • @himanshukrdiwedi4554
    @himanshukrdiwedi4554 ปีที่แล้ว

    Nice

  • @Doggy_Styles_Coding
    @Doggy_Styles_Coding ปีที่แล้ว

    nice coding keep it up ,)

  • @letticonionepic
    @letticonionepic ปีที่แล้ว

    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.

    • @rayaqin
      @rayaqin 11 หลายเดือนก่อน

      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.

  • @YosvanyBlanco
    @YosvanyBlanco ปีที่แล้ว

    You did a great job explaining the intuition on this one thank you!

  • @sanjanar9198
    @sanjanar9198 ปีที่แล้ว

    Great explanation! thank you so much!!

  • @leelashreerajendran8726
    @leelashreerajendran8726 ปีที่แล้ว

    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)

  • @astroswell
    @astroswell ปีที่แล้ว

    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?

    • @CodeCode-pz6oo
      @CodeCode-pz6oo ปีที่แล้ว

      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.

  • @macolulu
    @macolulu ปีที่แล้ว

    Hi, Lulu. Greetings from Lulu.

  • @trlabhishekh3472
    @trlabhishekh3472 ปีที่แล้ว

    The explanation was quite good, but it could have been even better with the code

    • @CodeCode-pz6oo
      @CodeCode-pz6oo ปีที่แล้ว

      Thanks for the suggestion. Since so many people asking for the coding part, I'll upload a new video for coding recently.

  • @debochando
    @debochando ปีที่แล้ว

    I am trying to solve this problem right now. Your video came in the right moment. Thank you so much.

  • @ANURAGSINGH-nl2ll
    @ANURAGSINGH-nl2ll ปีที่แล้ว

    well explained thanks

  • @ybybyb8bo592
    @ybybyb8bo592 ปีที่แล้ว

    28:11 total = 0,1,8,32(should be 64)

  • @saurabhsingh6325
    @saurabhsingh6325 ปีที่แล้ว

    Thanks for your nice explanation! <3

  • @rahulsawant2093
    @rahulsawant2093 ปีที่แล้ว

    Great Explanation, Thanks Keep it Up

  • @DEEPAKKUMAR-xe2vb
    @DEEPAKKUMAR-xe2vb ปีที่แล้ว

    Explanation was good but it would be more helpful if you explain the code too, Btw keep up the good work. 🙌🙌

  • @_SAUBHAGYASINGH-yv1hp
    @_SAUBHAGYASINGH-yv1hp ปีที่แล้ว

    if this is ur original voice then let me say your voice is very cute

  • @noppa2576
    @noppa2576 ปีที่แล้ว

    Thanks