- 1 113
- 71 755
LetsCode
เข้าร่วมเมื่อ 15 ก.พ. 2021
Leetcode on live, I use python to solve leetcode problems.
2025 target!
1 Reach 1000 subscribers.
2 Reach 100, 000 views.
3 Reach 3000 views for 5 videos
2025 target!
1 Reach 1000 subscribers.
2 Reach 100, 000 views.
3 Reach 3000 views for 5 videos
Leetcode 2972. Count the Number of Incremovable Subarrays II (2 pointers)
2972. Count the Number of Incremovable Subarrays II
มุมมอง: 2
วีดีโอ
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 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)
great explanation
I never would have thought of this solution. Thank you!
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
Yes, right thanks🎉
谢谢
@@g.1771 不客气
Very well explained. Thank you so much for this!
what extension do you use for drawing?
chrome extension Web Paint Tool - draw online
@@letsleetcode2024 thanks
a mistake at 3:35, should be 9, 9, and 1 for first example
great video!
🔥🔥🔥🫡
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)
Exactly this was asked to me in microsoft . May i know How you got to know ?
use premium
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
哥好牛
沖!
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])
Great explanation thanks a lot!
Great explaination!!
thank you so much
clear explanation on the core idea !!
very good explanation = thank you so much
This is the best explanation and solution to the problem I could find on TH-cam! Thanks!
Glad it helped!
Great video! The most detailed explaination I saw! Please keep posting! It will be even better if you could provide your code, thanks!
Thank you, I will
keep posting BoSS
@@saranshthukral4021 will post more if it is useful😀
instand of going from 2 directions, do it as cherry pickup 1, start from 1 direction
nice!
very well sir. Thanks
Thanks
👍👍
it may have been easier to understand by keeping the/one example
yes, it makes sense to keep consistant with examples, I'll keep in mind.
Great explanation. Thank you so much. Keep this great work up !! 🥰
thanks😃
Keep up the good work!
good explanation = thank you so much + please continue❤❤
thanks, every time when I start to give up and received the message that cheer me up to continue.❤
Thanks a lot this was helpful👍👍
给我讲懂了,太强了
What is your intution when you come across this problem?
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!
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.
@@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,
very easy and intuitive solution
thanks mate
Thanks!
No problem!
Nice reading comprehension
Thank you!
@@letscode1000 😑😑
Thanks for the solution, this would be very hard without sortedlist.
definitely
Hey buddy I have no idea about this but Im still watching..!
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.
@@letscode1000 Everything in my mind, So how can I access my brain info..!
If everything in my mind, so how can I access my brain info.. !
@@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.
@@letscode1000 hey buddy how can I send video to better understanding for me..!
This was helpful thanks!
thanks
why do you draw that grid's border as a semi-circle? that should be a straight line god damn it!
this is a 4 color problem
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
Elegant
we can use return list(A.intersection(P)) to make it mush easier to write
If someone is good at codeforces problems can they easily become good at leetcode problems
Thanks for the video, helped me out. keep up the good work! 🌸
Thank you! Will do!