why i can't do something like this: while True: ans = rand7() + rand7() if ans <= 9: return ans + 1
@shaypatrickcormac276524 күн бұрын
give me your time machine
@healedcoffeeАй бұрын
this is so helpful! love how you count the total subarrays using the left & right bracket!
@draugno7Ай бұрын
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
@nhatnamnguyenminh7926Ай бұрын
Simple makes PERFECT!
@bluewhale37Ай бұрын
Thank you so much kacy.
@rushio86732 ай бұрын
loved it, one of the easiest and best explanation. Thank you !
@VishnuvarthanM-n2f3 ай бұрын
tqq for this stuff ^^
@JDogMcSteezy3 ай бұрын
Thank you for the iterative explanation
@JDogMcSteezy3 ай бұрын
Thanks! The editorial did not really explain it and the popular channels stopped at the iterative solution
@Account-fi1cu3 ай бұрын
solved it intuitively using max heap,, but this is more efficient.. alas less obvious to wrap my head around it. thankyou !
@amadhurip99463 ай бұрын
this guy is so cool
@KacyCodes2 ай бұрын
@@amadhurip9946 😎
@tomreyker93293 ай бұрын
The proves were real nice. I was struggling with it. Thanks.
@web-unlocked3 ай бұрын
Love you solution (and your voice)
@ZachDift-kc4nk4 ай бұрын
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 😭
@kasthurirangan34554 ай бұрын
instead of adding only odd length why are u adding all ?
@aammarahmad4 ай бұрын
epic vid! thx!
@shahidullahmuffakir6684 ай бұрын
Good job brother, you explained the whole algo withing the first 4th minute. thank you. keep it up.
@mayankbhanot89864 ай бұрын
omg, the prefix sum explanation was so good
@jaideepdahiya40575 ай бұрын
good explanation
@torr-o8v5 ай бұрын
is it really hard to grasp or I'm dumb?
@21centuryschizoid5 ай бұрын
I missed why this algorithm is nlogn
@NimishJindal-e6m4 ай бұрын
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
@santiagoramirez8515 ай бұрын
Awesome!
@raghvendrakumarrai71835 ай бұрын
Great Explanation! Thank you for such a beautiful explanation!😊😊
@ndot84996 ай бұрын
Bro u R me Fr
@oliverlooker6 ай бұрын
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.
@fredyrocky6 ай бұрын
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.
@sahilamin2197 ай бұрын
i like your hair, do not you get dandruff !!
@KacyCodes7 ай бұрын
Never cause I use anti-dandruff shampoo twice a week 😎
@sourabhsingh44497 ай бұрын
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
@IAmIndraTheGod8 ай бұрын
Nice explanation and solution. appreciate your work.
@homeroserna99838 ай бұрын
Good solution. I like that you did it with regular arrays makes it easy to transfer the logic to other languages.
@edwinrosemond9898 ай бұрын
Incredible video! really good explanation thanks so much
@ithsigma9 ай бұрын
Very clever explanation. Thank you so much!
@anupamchopra57539 ай бұрын
Thank you brother beautiful explanation
@aaditya_879 ай бұрын
awesome!
@codeman00179 ай бұрын
damn bro great explanation please continue doing vedioes
@glidermcglide92889 ай бұрын
This guy gives off the vibes of a HERO !
@shriramravichandran295610 ай бұрын
Hey Kacy the explanation was so good. Can you teach monotonic queues as well?
@jui20oct10 ай бұрын
Out of all the vides on youtube, I understood your explanation! Thank you!
@axlrose508210 ай бұрын
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!
@sandeshsinha917410 ай бұрын
You won’t remember the solution today. That day was a short term memory I think. 😬😬
@johnapple347110 ай бұрын
2007 vibes
@Rahul-pr1zr10 ай бұрын
How did you come up with the idea of choosing the bottom left or top right for calculating the no. of elements <= mid?
@vydruth10 ай бұрын
Thanks for the clear explanation! Very helpful! 👍
@hangchen10 ай бұрын
Code Ninja
@tod311711 ай бұрын
THANK YOU!!!!!!!
@alanchen687211 ай бұрын
It is very useful. Thanks mate.
@haqinzmamul1211 ай бұрын
Great Kacy...
@potodds_trading11 ай бұрын
Great explanation in Java code. Better than some of the Python solution as they use built-in functions that let you "see" the solution as clearly.
@pravinthganesan855211 ай бұрын
Thanks for the explanation, able to understand the logic behind the solution for range addition and related problems, Thanks.