LetsCode
LetsCode
  • 1 113
  • 71 755

วีดีโอ

Leetcode 1574. Shortest Subarray to be Removed to Make Array Sorted (2 pointers)
มุมมอง 611 ชั่วโมงที่ผ่านมา
1574. Shortest Subarray to be Removed to Make Array Sorted
Leetcode 1498. Number of Subsequences That Satisfy the Given Sum Condition (2 pointers)
มุมมอง 34 ชั่วโมงที่ผ่านมา
1498. Number of Subsequences That Satisfy the Given Sum Condition if l r, means the minimum number equal the maximum number, we use 2 * val less than and equal to target or more than target to check if we want to add this case or not.
Leetcode 1616. Split Two Strings to Make Palindrome (two pointers)
มุมมอง 24 ชั่วโมงที่ผ่านมา
1616. Split Two Strings to Make Palindrome
Leetcode 923. 3Sum With Multiplicity (dfs + cache)
มุมมอง 44 ชั่วโมงที่ผ่านมา
923. 3Sum With Multiplicity
Leetcode 2444. Count Subarrays With Fixed Bounds (three pointers)
มุมมอง 397 ชั่วโมงที่ผ่านมา
2444. Count Subarrays With Fixed Bounds
Leetcode 2367. Number of Arithmetic Triplets (three pointers)
มุมมอง 297 ชั่วโมงที่ผ่านมา
2367. Number of Arithmetic Triplets
Leetcode 2495. Number of Subarrays Having Even Product (dp)
มุมมอง 109 ชั่วโมงที่ผ่านมา
2495. Number of Subarrays Having Even Product
Leetcode 3350. Adjacent Increasing Subarrays Detection II (list groups)
มุมมอง 129 ชั่วโมงที่ผ่านมา
3350. Adjacent Increasing Subarrays Detection II
Leetcode 3011. Find if Array Can Be Sorted (list groups)
มุมมอง 309 ชั่วโมงที่ผ่านมา
3011. Find if Array Can Be Sorted
Leetcode 845. Longest Mountain in Array (list groups)
มุมมอง 412 ชั่วโมงที่ผ่านมา
845. Longest Mountain in Array
Leetcode 1887. Reduction Operations to Make the Array Elements Equal (list groups)
มุมมอง 1112 ชั่วโมงที่ผ่านมา
1887. Reduction Operations to Make the Array Elements Equal
Leetcode 2841. Maximum Sum of Almost Unique Subarray (fixed sliding window)
มุมมอง 414 ชั่วโมงที่ผ่านมา
2841. Maximum Sum of Almost Unique Subarray
Leetcode 1052. Grumpy Bookstore Owner (fixed sliding window)
มุมมอง 214 ชั่วโมงที่ผ่านมา
1052. Grumpy Bookstore Owner
Leetcode 2090. K Radius Subarray Averages (fixed sliding window)
มุมมอง 514 ชั่วโมงที่ผ่านมา
2090. K Radius Subarray Averages
Leetcode 643. Maximum Average Subarray I (fixed sliding window)
มุมมอง 314 ชั่วโมงที่ผ่านมา
Leetcode 643. Maximum Average Subarray I (fixed sliding window)
Leetcode 1456. Maximum Number of Vowels in a Substring of Given Length (fixed sliding window)
มุมมอง 514 ชั่วโมงที่ผ่านมา
Leetcode 1456. Maximum Number of Vowels in a Substring of Given Length (fixed sliding window)
Leetcode 362. Design Hit Counter (binary search)
มุมมอง 816 ชั่วโมงที่ผ่านมา
Leetcode 362. Design Hit Counter (binary search)
Leetcode 1798. Maximum Number of Consecutive Values You Can Make (greedy)
มุมมอง 1016 ชั่วโมงที่ผ่านมา
Leetcode 1798. Maximum Number of Consecutive Values You Can Make (greedy)
2952. Minimum Number of Coins to be Added (greedy)
มุมมอง 816 ชั่วโมงที่ผ่านมา
2952. Minimum Number of Coins to be Added (greedy)
Leetcode 330. Patching Array (greedy)
มุมมอง 1516 ชั่วโมงที่ผ่านมา
Leetcode 330. Patching Array (greedy)
Leetcode 302. Smallest Rectangle Enclosing Black Pixels (DFS)
มุมมอง 3221 ชั่วโมงที่ผ่านมา
Leetcode 302. Smallest Rectangle Enclosing Black Pixels (DFS)
Leetcode 1533. Find the Index of the Large Integer (binary search)
มุมมอง 38วันที่ผ่านมา
Leetcode 1533. Find the Index of the Large Integer (binary search)
Leetcode 1228. Missing Number In Arithmetic Progression (math)
มุมมอง 12วันที่ผ่านมา
Leetcode 1228. Missing Number In Arithmetic Progression (math)
Leetcode 1538. Guess the Majority in a Hidden Array (math)
มุมมอง 15วันที่ผ่านมา
Leetcode 1538. Guess the Majority in a Hidden Array (math)
Leetcode 1134. Armstrong Number (math)
มุมมอง 3วันที่ผ่านมา
Leetcode 1134. Armstrong Number (math)
Leetcode 1066. Campus Bikes II (bit dp)
มุมมอง 8วันที่ผ่านมา
Leetcode 1066. Campus Bikes II (bit dp)
Leetcode 1057. Campus Bikes (set and sort)
มุมมอง 6วันที่ผ่านมา
Leetcode 1057. Campus Bikes (set and sort)
Leetcode 358. Rearrange String k Distance Apart (stack)
มุมมอง 21วันที่ผ่านมา
Leetcode 358. Rearrange String k Distance Apart (stack)
Leetcode 582. Kill Process (graph dfs)
มุมมอง 23วันที่ผ่านมา
Leetcode 582. Kill Process (graph dfs)

ความคิดเห็น

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

    great explanation

  • @hynguyen1411
    @hynguyen1411 6 วันที่ผ่านมา

    I never would have thought of this solution. Thank you!

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

    you could check if count > k within while loop if so then return true. This will save some cpu cycles. Also, use for s in sweetness to reduce the dereference

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

      Yes, right thanks🎉

  • @g.1771
    @g.1771 12 วันที่ผ่านมา

    谢谢

    • @letscode1000
      @letscode1000 12 วันที่ผ่านมา

      @@g.1771 不客气

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

    Very well explained. Thank you so much for this!

  • @MasterandMargarita-h2w
    @MasterandMargarita-h2w 22 วันที่ผ่านมา

    what extension do you use for drawing?

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

    a mistake at 3:35, should be 9, 9, and 1 for first example

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

    great video!

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

    🔥🔥🔥🫡

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

    the coding: class Solution: def findInMountainArray(self, target: int, mountainArr: 'MountainArray') -> int: def findPeak(): l, r = 1, mountainArr.length() - 2 res = 0 while l <= r: m = (l + r) // 2 if mountainArr.get(m) > mountainArr.get(m + 1): res = m r = m - 1 else: l = m + 1 return res pIndex = findPeak() def binary_search(l, r): while l <= r: m = (l + r) // 2 if mountainArr.get(m) > target: r = m - 1 elif mountainArr.get(m) < target: l = m + 1 else: return m return -1 def binary_search2(l, r): while l <= r: m = (l + r) // 2 if mountainArr.get(m) > target: l = m + 1 elif mountainArr.get(m) < target: r = m - 1 else: return m return -1 idx = -1 idx = binary_search(0, pIndex) if idx != -1: return idx return binary_search2(pIndex, mountainArr.length() - 1)

  • @HariKrishnan-ff4hf
    @HariKrishnan-ff4hf หลายเดือนก่อน

    Exactly this was asked to me in microsoft . May i know How you got to know ?

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

      use premium

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

    some tech issues, here is the whole coding: class Solution: def minimumLevels(self, possible: List[int]) -> int: nums = [] for p in possible: if p == 1: nums.append(p) else: nums.append(-1) s = sum(nums) res = 0 for i, n in enumerate(nums): res += n if res > s - res and i < len(nums) - 1: return i + 1 return -1

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

    哥好牛

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

    沖!

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

    for anyone who check the video may need the last code, or you can code by yourself. class Solution: def findLadders(self, beginWord: str, endWord: str, wordList: List[str]) -> List[List[str]]: wordSet = set(wordList) ans = [] if endWord not in wordSet: return ans l, s1, s2 = len(beginWord), {beginWord}, {endWord} flag, d = False, defaultdict(list) while s1: s = set() for w in s1: words = [w[:i] + c + w[i + 1:] for c in ascii_lowercase for i in range(l)] for word in words: if word in s2: flag = True if word in wordSet: s.add(word) d[word].append(w) for word in s: wordSet.remove(word) s1 = s if flag: break def backtrack(cur, res): if cur == beginWord: ans.append(res[::-1]) return for word in d[cur]: backtrack(word, res + [word]) return ans return backtrack(endWord, [endWord])

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

    Great explanation thanks a lot!

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

    Great explaination!!

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

    thank you so much

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

    clear explanation on the core idea !!

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

    very good explanation = thank you so much

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

    This is the best explanation and solution to the problem I could find on TH-cam! Thanks!

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

      Glad it helped!

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

    Great video! The most detailed explaination I saw! Please keep posting! It will be even better if you could provide your code, thanks!

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

      Thank you, I will

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

    keep posting BoSS

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

      @@saranshthukral4021 will post more if it is useful😀

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

    instand of going from 2 directions, do it as cherry pickup 1, start from 1 direction

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

    nice!

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

    very well sir. Thanks

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

    Thanks

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

    👍👍

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

    it may have been easier to understand by keeping the/one example

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

      yes, it makes sense to keep consistant with examples, I'll keep in mind.

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

    Great explanation. Thank you so much. Keep this great work up !! 🥰

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

      thanks😃

  • @basic-2-advance
    @basic-2-advance 4 หลายเดือนก่อน

    Keep up the good work!

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

    good explanation = thank you so much + please continue❤❤

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

      thanks, every time when I start to give up and received the message that cheer me up to continue.❤

  • @Dagemawi-j7i
    @Dagemawi-j7i 4 หลายเดือนก่อน

    Thanks a lot this was helpful👍👍

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

    给我讲懂了,太强了

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

    What is your intution when you come across this problem?

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

    Hi, I love your content! 🎥 I specialize in video editing and thumbnail design, and I’d love to help enhance your videos and boost your channel's visuals. If you’re interested, let’s chat about how I can contribute to your amazing work!

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

      thanks a lot, I still need more time to focus on how to improve my English skills and algorithms skills. Boosting the channel is not my target currently.

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

      @@letscode1000 Thank you for your time and consideration. I completely understand and appreciate your response. If you ever have a need for video editing or thumbnail design services in the future, please don’t hesitate to reach out. Wishing you continued success with your channel! Best regards,

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

    very easy and intuitive solution

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

      thanks mate

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

    Thanks!

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

      No problem!

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

    Nice reading comprehension

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

    Thanks for the solution, this would be very hard without sortedlist.

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

      definitely

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

    Hey buddy I have no idea about this but Im still watching..!

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

      I know it seems hard when you first come across linked list, but it will be much easier when you’re getting familiar with basic data structure like tree and graph, linked list is basic disconnect and connected 2 nodes, from beginning you can practice with making a drawing, after that,everything is in your mind, you know how to do it.

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

      @@letscode1000 Everything in my mind, So how can I access my brain info..!

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

      If everything in my mind, so how can I access my brain info.. !

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

      @@rajushankpoul9928 this is not the kind of hard problems need to use brain, only some harder problems need to use brain, use your mind is like memory and experience.

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

      @@letscode1000 hey buddy how can I send video to better understanding for me..!

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

    This was helpful thanks!

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

    why do you draw that grid's border as a semi-circle? that should be a straight line god damn it!

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

    this is a 4 color problem

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

    class Solution: def findTheDistanceValue(self, arr1: List[int], arr2: List[int], d: int) -> int: myset = set(arr2) count = 0 def process(i,d): ans = [i] while d>=0: ans.extend([i-d,i+d]) d-=1 return ans for i in arr1: acceptable_values=process(i,d) ll=list(filter(lambda x:x in myset,acceptable_values)) if len(ll)>=1: continue else: count+=1 return count

  • @МаркЛевичкин
    @МаркЛевичкин 5 หลายเดือนก่อน

    Elegant

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

    we can use return list(A.intersection(P)) to make it mush easier to write

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

    If someone is good at codeforces problems can they easily become good at leetcode problems

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

    Thanks for the video, helped me out. keep up the good work! 🌸

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

      Thank you! Will do!