- 48
- 81 434
Kacy Codes
Приєднався 20 лют 2022
Just a hero for fun.
LeetCode 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Email: kacycodes@gmail.com
Переглядів: 1 261
Відео
LeetCode 2040. Kth Smallest Product of Two Sorted Arrays
Переглядів 1,1 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 2055. Plates Between Candles - O(n + q)
Переглядів 4,6 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 300. Longest Increasing Subsequence - O(n log n)
Переглядів 6 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 300. Longest Increasing Subsequence (Bottom Up DP)
Переглядів 1272 роки тому
Email: kacycodes@gmail.com
LeetCode 300. Longest Increasing Subsequence (Top Down DP)
Переглядів 4352 роки тому
Email: kacycodes@gmail.com
LeetCode 225. Implement Stack using Queues (2 queues & 1 queue)
Переглядів 932 роки тому
Email: kacycodes@gmail.com
LeetCode 1135. Connecting Cities With Minimum Cost
Переглядів 1,1 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 818. Race Car - BFS - O( target * log(target) )
Переглядів 2,8 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 1152. Analyze User Website Visit Pattern
Переглядів 3 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 4. Median of Two Sorted Arrays - O( log(min(n,m)) )
Переглядів 3202 роки тому
Email: kacycodes@gmail.com
K-th element of two sorted Arrays - O( log(min(n, m)) )
Переглядів 2,7 тис.2 роки тому
Email: kacycodes@gmail.com
LeetCode 236. Lowest Common Ancestor of a Binary Tree
Переглядів 1252 роки тому
LeetCode 236. Lowest Common Ancestor of a Binary Tree
LeetCode 269. Alien Dictionary (Kahn/BFS - Java)
Переглядів 3022 роки тому
LeetCode 269. Alien Dictionary (Kahn/BFS - Java)
LeetCode 269. Alien Dictionary (DFS - Java)
Переглядів 3492 роки тому
LeetCode 269. Alien Dictionary (DFS - Java)
LeetCode 210. Course Schedule II - (Kahn's Algorithm / BFS)
Переглядів 992 роки тому
LeetCode 210. Course Schedule II - (Kahn's Algorithm / BFS)
LeetCode 210. Course Schedule II - (DFS)
Переглядів 642 роки тому
LeetCode 210. Course Schedule II - (DFS)
LeetCode 207. Course Schedule I - (DFS)
Переглядів 472 роки тому
LeetCode 207. Course Schedule I - (DFS)
LeetCode 207. Course Schedule I - (Kahn's Algorithm / BFS)
Переглядів 9822 роки тому
LeetCode 207. Course Schedule I - (Kahn's Algorithm / BFS)
LeetCode 208. Implement Trie (Prefix Tree) - Java
Переглядів 6962 роки тому
LeetCode 208. Implement Trie (Prefix Tree) - Java
LeetCode 314. Binary Tree Vertical Order Traversal
Переглядів 1,3 тис.2 роки тому
LeetCode 314. Binary Tree Vertical Order Traversal
LeetCode 987. Vertical Order Traversal of a Binary Tree (PriorityQueue + DFS)
Переглядів 1052 роки тому
LeetCode 987. Vertical Order Traversal of a Binary Tree (PriorityQueue DFS)
LeetCode 285. Inorder Successor in BST (Recursive + Iterative approaches)
Переглядів 3042 роки тому
LeetCode 285. Inorder Successor in BST (Recursive Iterative approaches)
LeetCode 106. Construct Binary Tree from Inorder and Postorder Traversal
Переглядів 1382 роки тому
LeetCode 106. Construct Binary Tree from Inorder and Postorder Traversal
very bad explanation
Kacy will you ever upload again?
@@harsha1670 Maybe but not anytime soon. You can follow me on instagram if you want. My username is vale.codes
Best explanation on youtube ever!!!!!!!!
OMG! this is the only video where i understood the counting logic!!
Regarding the +1 when you figure out the number of odd length subarrays, you can just simply do ((left * right) +1 ) / 2. It works for odd and even length arrays. take [1]: left -> 1, right -> 1. then you'll have ((1*1)+1)/2 => 1. take [1,2]: idx = 0. left -> 1, right -> 2. then you'll have ((1*2)+1)/2 => 3/2 => 1 take [1,2,3]: idx = 0. left -> 1, right -> 3. then you'll have ((1*3)+1)/2 => 4/2 => 2...
EMO !!!
@@sidharthkumar2546 Never! **in denial listening to My Chemical Romance**
@@KacyCodes😂
why i can't do something like this: while True: ans = rand7() + rand7() if ans <= 9: return ans + 1
It’s impossible for that solution to return the numbers 1 and 2.
give me your time machine
this is so helpful! love how you count the total subarrays using the left & right bracket!
yeah, I'd totally come up with that on the spot... :')) dp(n^2) solution though, I think so. But I will remember this in case I need it
Simple makes PERFECT!
Thank you so much kacy.
loved it, one of the easiest and best explanation. Thank you !
tqq for this stuff ^^
Thank you for the iterative explanation
Thanks! The editorial did not really explain it and the popular channels stopped at the iterative solution
solved it intuitively using max heap,, but this is more efficient.. alas less obvious to wrap my head around it. thankyou !
this guy is so cool
@@amadhurip9946 😎
The proves were real nice. I was struggling with it. Thanks.
Love you solution (and your voice)
I got this question for amazon's OA and also a question similar to this for IBM's OA on the coding portion so this is a good question to review. Too bad i didnt know how to do it 😭
instead of adding only odd length why are u adding all ?
epic vid! thx!
Good job brother, you explained the whole algo withing the first 4th minute. thank you. keep it up.
omg, the prefix sum explanation was so good
good explanation
is it really hard to grasp or I'm dumb?
I missed why this algorithm is nlogn
I was also initially confused. But this is my understanding: Searching for an element in the pile is logn (binary search). We do this for every element in the array (n). So total complexity is nlogn
Awesome!
Great Explanation! Thank you for such a beautiful explanation!😊😊
Bro u R me Fr
I put this exact code into my IntelliJ IDE and it doesn't work. The power function doesn't work. Any ideas? I am trying to write an asymmetric encryption program and need to figure this out.
How about using two pointers. The first pointer starts from the beginning of each range and increases by 1 until it finds the first pipe and is less than end of range. The second pointer if (left pointer +1) and increases by 1 until it finds a pipe. We add the difference between both the pointers -1 as the current count of the stars. Then, we make the first pointer to start from the second pointer. And the secondpointer starts from firstpointer +1. We always check if the pointers are less than right.
i like your hair, do not you get dandruff !!
Never cause I use anti-dandruff shampoo twice a week 😎
Thanks man, it was very helpful and so much to learn form this video more than what was needed to solve question. Keep up the good work of spreading knowledge
Nice explanation and solution. appreciate your work.
Good solution. I like that you did it with regular arrays makes it easy to transfer the logic to other languages.
Incredible video! really good explanation thanks so much
Very clever explanation. Thank you so much!
Thank you brother beautiful explanation
awesome!
damn bro great explanation please continue doing vedioes
This guy gives off the vibes of a HERO !
Hey Kacy the explanation was so good. Can you teach monotonic queues as well?
Out of all the vides on youtube, I understood your explanation! Thank you!
You know it's a great explanation when you can code and submit the solution for yourself without even reading a single line of code from the instructor lol. Thank you!
You won’t remember the solution today. That day was a short term memory I think. 😬😬
2007 vibes
How did you come up with the idea of choosing the bottom left or top right for calculating the no. of elements <= mid?
Thanks for the clear explanation! Very helpful! 👍
Code Ninja