- Видео 1 037
- Просмотров 67 050
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 1986. Minimum Number of Work Sessions to Finish the Tasks (bit mask)
1986. Minimum Number of Work Sessions to Finish the Tasks
Просмотров: 5
Видео
Leetcode 2305. Fair Distribution of Cookies (backtrack)
Просмотров 321 час назад
2305. Fair Distribution of Cookies
Leetcode 1269. Number of Ways to Stay in the Same Place After Some Steps (linear dp)
Просмотров 172 часа назад
1269. Number of Ways to Stay in the Same Place After Some Steps
Leetcode 2034. Stock Price Fluctuation (sorted list)
Просмотров 102 часа назад
2034. Stock Price Fluctuation
Leetcode 2349. Design a Number Container System (sorted list or heap)
Просмотров 144 часа назад
2349. Design a Number Container System
Leetcode 1882. Process Tasks Using Servers (2 heaps)
Просмотров 67 часов назад
1882. Process Tasks Using Servers
Leetcode 1792. Maximum Average Pass Ratio (heap)
Просмотров 207 часов назад
1792. Maximum Average Pass Ratio
Leetcode 1801. Number of Orders in the Backlog (2 heaps)
Просмотров 59 часов назад
1801. Number of Orders in the Backlog
Leetcode 1942. The Number of the Smallest Unoccupied Chair (2 heaps)
Просмотров 79 часов назад
1942. The Number of the Smallest Unoccupied Chair
Leetcode 3296. Minimum Number of Seconds to Make Mountain Height Zero (heap)
Просмотров 612 часов назад
3296. Minimum Number of Seconds to Make Mountain Height Zero
Leetcode 1845. Seat Reservation Manager (min heap)
Просмотров 712 часов назад
1845. Seat Reservation Manager
Leetcode 3275. K-th Nearest Obstacle Queries (max heap)
Просмотров 512 часов назад
3275. K-th Nearest Obstacle Queries
Leetcode 703. Kth Largest Element in a Stream (heap)
Просмотров 514 часов назад
703. Kth Largest Element in a Stream
Leetcode 3066. Minimum Operations to Exceed Threshold Value II (min heap)
Просмотров 514 часов назад
Leetcode 3066. Minimum Operations to Exceed Threshold Value II (min heap)
Leetcode 2530. Maximal Score After Applying K Operations (max heap)
Просмотров 414 часов назад
Leetcode 2530. Maximal Score After Applying K Operations (max heap)
Leetcode 2336. Smallest Number in Infinite Set (min heap to sorted list to sorted set)
Просмотров 414 часов назад
Leetcode 2336. Smallest Number in Infinite Set (min heap to sorted list to sorted set)
Leetcode 2558. Take Gifts From the Richest Pile (max heap)
Просмотров 614 часов назад
Leetcode 2558. Take Gifts From the Richest Pile (max heap)
Leetcode 3264. Final Array State After K Multiplication Operations I (min heap)
Просмотров 314 часов назад
Leetcode 3264. Final Array State After K Multiplication Operations I (min heap)
Leetcode 1046. Last Stone Weight (max heap)
Просмотров 814 часов назад
Leetcode 1046. Last Stone Weight (max heap)
Leetcode 484. Find Permutation (stack)
Просмотров 1716 часов назад
Leetcode 484. Find Permutation (stack)
Leetcode 895. Maximum Frequency Stack (sorted list and dict)
Просмотров 619 часов назад
Leetcode 895. Maximum Frequency Stack (sorted list and dict)
Leetcode 1762. Buildings With an Ocean View (monotonic stack)
Просмотров 319 часов назад
Leetcode 1762. Buildings With an Ocean View (monotonic stack)
Leetcode 716. Max Stack (Sorted List)
Просмотров 919 часов назад
Leetcode 716. Max Stack (Sorted List)
Leetcode 1063. Number of Valid Subarrays (monotonic stack)
Просмотров 619 часов назад
Leetcode 1063. Number of Valid Subarrays (monotonic stack)
Leetcode 902. Numbers At Most N Given Digit Set (digit dp)
Просмотров 18День назад
Leetcode 902. Numbers At Most N Given Digit Set (digit dp)
Leetcode 2376. Count Special Integers (digit dp with template)
Просмотров 7День назад
Leetcode 2376. Count Special Integers (digit dp with template)
Leetcode 28. Find the Index of the First Occurrence in a String (kmp with example)
Просмотров 11День назад
Leetcode 28. Find the Index of the First Occurrence in a String (kmp with example)
Leetcode 982. Triples with Bitwise AND Equal To Zero (2 sum)
Просмотров 24День назад
Leetcode 982. Triples with Bitwise AND Equal To Zero (2 sum)
what extension do you use for drawing?
chrome extension Web Paint Tool - draw online
a mistake at 3:35, should be 9, 9, and 1 for first example
great video!
Great analysis, thank you! A bit off-topic, but I wanted to ask: My OKX wallet holds some USDT, and I have the seed phrase. (alarm fetch churn bridge exercise tape speak race clerk couch crater letter). How can I transfer them to Binance?
🔥🔥🔥🫡
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 RUclips! 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!
I have a doubt why we cannot make prefix sum of size same as nums size, why we initialize prefix sum 0 at 0 index
It's also ok without zero padding, we can prepare a padding 0 for easy handle edge cases, like prefix sum from index 2 - index 0, if no zero padding, you need to have the edge cases check and add more lines of code. if it has no index 0 padding, you need the if check to check if it is zero.
Thank you bro, this solution really helped me...
Nice explanation!
thank you!