Happy Coding
Happy Coding
  • 560
  • 1 448 229

วีดีโอ

LeetCode 2025. Maximum Number of Ways to Partition an Array
มุมมอง 3.5K3 ปีที่แล้ว
LeetCode 2025. Maximum Number of Ways to Partition an Array
LeetCode 2019. The Score of Students Solving Math Expression
มุมมอง 1.3K3 ปีที่แล้ว
LeetCode 2019. The Score of Students Solving Math Expression
LeetCode 782. Transform to Chessboard
มุมมอง 1.1K3 ปีที่แล้ว
LeetCode 782. Transform to Chessboard
LeetCode 2014. Longest Subsequence Repeated k Times
มุมมอง 3.1K3 ปีที่แล้ว
LeetCode 2014. Longest Subsequence Repeated k Times
LeetCode 2013. Detect Squares
มุมมอง 1.2K3 ปีที่แล้ว
LeetCode 2013. Detect Squares
LeetCode 115. Distinct Subsequences
มุมมอง 7573 ปีที่แล้ว
LeetCode 115. Distinct Subsequences
LeetCode 2009. Minimum Number of Operations to Make Array Continuous
มุมมอง 5K3 ปีที่แล้ว
LeetCode 2009. Minimum Number of Operations to Make Array Continuous
LeetCode 2008. Maximum Earnings From Taxi
มุมมอง 5K3 ปีที่แล้ว
LeetCode 2008. Maximum Earnings From Taxi
LeetCode 2007. Find Original Array From Doubled Array
มุมมอง 5K3 ปีที่แล้ว
LeetCode 2007. Find Original Array From Doubled Array
LeetCode 978. Longest Turbulent Subarray
มุมมอง 1.2K3 ปีที่แล้ว
LeetCode 978. Longest Turbulent Subarray
LeetCode 882. Reachable Nodes In Subdivided Graph
มุมมอง 1.6K3 ปีที่แล้ว
LeetCode 882. Reachable Nodes In Subdivided Graph
LeetCode 2003. Smallest Missing Genetic Value in Each Subtree
มุมมอง 1.4K3 ปีที่แล้ว
LeetCode 2003. Smallest Missing Genetic Value in Each Subtree
LeetCode 2002. Maximum Product of the Length of Two Palindromic Subsequences
มุมมอง 8473 ปีที่แล้ว
LeetCode 2002. Maximum Product of the Length of Two Palindromic Subsequences
LeetCode 446. Arithmetic Slices II - Subsequence
มุมมอง 2.4K3 ปีที่แล้ว
LeetCode 446. Arithmetic Slices II - Subsequence
LeetCode 764. Largest Plus Sign
มุมมอง 1.4K3 ปีที่แล้ว
LeetCode 764. Largest Plus Sign
LeetCode 1998. GCD Sort of an Array
มุมมอง 1.9K3 ปีที่แล้ว
LeetCode 1998. GCD Sort of an Array
LeetCode 1997. First Day Where You Have Been in All the Rooms
มุมมอง 1.1K3 ปีที่แล้ว
LeetCode 1997. First Day Where You Have Been in All the Rooms
LeetCode 1996. The Number of Weak Characters in the Game
มุมมอง 4.1K3 ปีที่แล้ว
LeetCode 1996. The Number of Weak Characters in the Game
LeetCode 1994. The Number of Good Subsets
มุมมอง 2.2K3 ปีที่แล้ว
LeetCode 1994. The Number of Good Subsets
LeetCode 1993. Operations on Tree
มุมมอง 6273 ปีที่แล้ว
LeetCode 1993. Operations on Tree
LeetCode 1987. Number of Unique Good Subsequences
มุมมอง 3.6K3 ปีที่แล้ว
LeetCode 1987. Number of Unique Good Subsequences
LeetCode 940. Distinct Subsequences II
มุมมอง 2.5K3 ปีที่แล้ว
LeetCode 940. Distinct Subsequences II
LeetCode 587. Erect the Fence
มุมมอง 1.7K3 ปีที่แล้ว
LeetCode 587. Erect the Fence
LeetCode 1986. Minimum Number of Work Sessions to Finish the Tasks
มุมมอง 4.5K3 ปีที่แล้ว
LeetCode 1986. Minimum Number of Work Sessions to Finish the Tasks
LeetCode 95. Unique Binary Search Trees II
มุมมอง 6K3 ปีที่แล้ว
LeetCode 95. Unique Binary Search Trees II
LeetCode 1977. Number of Ways to Separate Numbers
มุมมอง 3.2K3 ปีที่แล้ว
LeetCode 1977. Number of Ways to Separate Numbers
LeetCode 565. Array Nesting
มุมมอง 8063 ปีที่แล้ว
LeetCode 565. Array Nesting
LeetCode 1982. Find Array Given Subset Sums
มุมมอง 3.4K3 ปีที่แล้ว
LeetCode 1982. Find Array Given Subset Sums
LeetCode 1981. Minimize the Difference Between Target and Chosen Elements
มุมมอง 2K3 ปีที่แล้ว
LeetCode 1981. Minimize the Difference Between Target and Chosen Elements

ความคิดเห็น

  • @abhijit-sarkar
    @abhijit-sarkar 4 วันที่ผ่านมา

    Same problem as LeetCode 31: Next Permutation

  • @fergalhennessy775
    @fergalhennessy775 4 วันที่ผ่านมา

    good video gang, here in 2024

  • @SeanKearney-g7d
    @SeanKearney-g7d 10 วันที่ผ่านมา

    if you don't like math do this: new_i = (i + 1) if j == 8 else i new_j = 0 if j == 8 else (j + 1)

  • @vipulgoyal2370
    @vipulgoyal2370 10 วันที่ผ่านมา

    I could not understand the part where for each value of k (guess number), why we took minimum of it? If we are looking for worst case, shouldn't we take a worst guess or all the guesses we made?

  • @habilismayilov838
    @habilismayilov838 11 วันที่ผ่านมา

    Worst explanation ever.

  • @provarence7361
    @provarence7361 15 วันที่ผ่านมา

    Great solution!

  • @amitarya4894
    @amitarya4894 17 วันที่ผ่านมา

    Thank you

  • @ayaannadamal9218
    @ayaannadamal9218 18 วันที่ผ่านมา

    Thank you, very nice explanation!

  • @abdulsaboor2168
    @abdulsaboor2168 20 วันที่ผ่านมา

    I dont like python syntax its confusing and too much things going on in a single line

  • @akifismail6597
    @akifismail6597 23 วันที่ผ่านมา

    As start end are only positive ints. Just have an array of frequencies and binary search the new booking in so its n*log(n)

  • @jesuscruz8008
    @jesuscruz8008 25 วันที่ผ่านมา

    this was a good explanation my first thought was to do dfs for each cell but I wasn't sure how to check the min width and make sure they are a valid recatangle

  • @rakshitgupta6147
    @rakshitgupta6147 29 วันที่ผ่านมา

    best explanation sir. thanks you so much

  • @anoops7974
    @anoops7974 29 วันที่ผ่านมา

    Thank you

  • @keystarr
    @keystarr 29 วันที่ผ่านมา

    thank you for the clear explanation!

  • @akhilmn4013
    @akhilmn4013 29 วันที่ผ่านมา

    I think an important thing to sort of internalize is that when you insert a parity into the hashmap, you are guaranteed that this is the earliest index at which this parity is found. So everytime you encounter this parity again, you are comparing it with the earliest index you encountered this parity, which gives you the longest length as i keeps increasing. Thanks for the great video, took a little while to digest but seems to be very helpful in solving problems with a similar recurring pattern!

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

    nice one , smart and clear, it takes me a little time to figure out why BFS miss some result, and I tried to use BFS + DFS backtrack, but actually just use your idea will work

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

    Its marked hard now

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

    I am convinced all these hard problems are just one observation away from becoming a medium problem. Like how you made : numMoves > len(graph)*2 return 0

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

      Not this hard problem! that condition of `numMoves > len(graph) * 2 ` utterly fails with the wrong answer if you try it now with new test-cases.

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

      @@soumyajitganguly2593 you're right, it was kinda random. But it works when you make it 5 times..

  • @ManasiSingh-gl7fz
    @ManasiSingh-gl7fz หลายเดือนก่อน

    I was getting Stack Overflow in DP but BFS worked fine

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

    gee, improve your English

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

    your explanation helped a lot!! Thanks mate !💌

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

    nice explanation. I made one improvement: if we create seen as a map instead of a set, with the keys being (nx, ny) and the values being cur_k or cur_k - 1, we can ignore any k that is less than what we already have in the map (since a lower k will never result in a better path). This decreased the run time for me a substantial amount.

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

    Thank you, this was very well explained. Now sure how I am supposed to solve this during an interview though..

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

    the worst explanation of all times!

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

    Explanation is not clear at all, you keep saying it's obvious, but it's not.

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

    26:14 This part where you explained the intuition was brilliant ❤

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

    just add a case sumCount[0] = 0 for solving it

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

    surprisingly this guy beat Neetcode in this problem's explanation. Good work !!

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

      True, neetcode has been a little hit and miss lately and the more I watch this channel the more Im liking the explanations here

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

    What do you mean by TRE at 05:50? out of memory limit?

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

      He said "TLE", time limit exceeded. Code took too long to execute.

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

      @@ooamritoo oh I see 😂

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

    You nailed it man!

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

    Damn, whats the time complexity?

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

      Bro m and n are very small so it will not effect so much

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

    Thank you! I was struggling with this one, you made it look easy lol

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

    For this input "abcdabcdabdeac" and k = 4, We can print "adcbadcbadbeac" as well "abcdabcdabcdae" ... it is nowhere mentioned in the question that we need to print lexicographically smallest string.

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

    Thanks for sharing!

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

    technically without the rebalance of the tree its still O(n) in the worst case

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

    Rabin Karp is technically O(n + m) where m is the length of the pattern we hash and search for. Here L can be as big as N, so we can simplify it to O(N). But still worth it to know the details. BTW it is O(n + m) is because of the calculating powers which takes time proportional to the L. In the textbook implementations, calculations are done using a while loop taking mod at each step so as to now overflow

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

    I dont know if you'll see this coz I guess you're not currently active in this channel.. but just wanted to let you know that all of your videos are easy to follow and super helpful ❤

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

    very hard to understand

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

    Great explanation

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

    Thank you so much!

  • @weeknd-w6g
    @weeknd-w6g 2 หลายเดือนก่อน

    why cant i do like these // Option 2: Place the current book on a new shelf int newShelfHeight = solve(books, idx + 1, shelfWidth - currWidth, currHeight + height, shelfWidth, dp);

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

      currHeight + height is where it seems it will fail, because when you decide to put a book on the new shelf, then the current maximum book height in that shelf will be nothing but the height of the current book. Hope it make sense.

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

    The problem was very boring but your explanation made it easy. Thank you!!!

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

    Hey Cheng! I recently discovered your channel and it's very helpful. No other channel has covered a lot of hard problems as yours does.. please continue this and your channel will blow up soon as people are moving towards solving more harder problems :)

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

    Adding a dummy node is a really nice trick. Thankyou!!

  • @Luffycoding-b1y
    @Luffycoding-b1y 2 หลายเดือนก่อน

    great explaination dude it really helped a lot...

  • @Luffycoding-b1y
    @Luffycoding-b1y 2 หลายเดือนก่อน

    man u deserve a lot of veiws.. ur problem solving way is very unique and very good.. this the best channel for sloving leetcode problems..

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

    Nice explanation! You make it seem very simple

  • @LinuxLingo
    @LinuxLingo 3 หลายเดือนก่อน

    not clear about ans = [ ]

  • @vikaskumarojha8616
    @vikaskumarojha8616 3 หลายเดือนก่อน

    Simple and robust solution.

  • @ashisranjandey7541
    @ashisranjandey7541 3 หลายเดือนก่อน

    Good explanation