Greg Hogg

Greg Hogg

Welcome to the channel! I make videos about Data Science and Coding Interview Preparation. I also offer 1 on 1 tutoring for Data Structures & Algos, and Analytics / ML! Email me at [email protected] 😊

Пікірлер

  • @mjanish9836
    @mjanish983614 минут бұрын

    Good Explanation !! ThankYou

  • @overclucker
    @overclucker35 минут бұрын

    Run the loop on the amount modulus the highest valued coin and add that to the quotient of the amount divided by the highest coin. We can avoid looping for anything below two of the highest coin's value. Also types in a duck typed language? What if you want to use non primitive int? There are other number types people might want to use.

  • @millfreedom
    @millfreedomСағат бұрын

    You got the question wrong and therefore your solution is bloated. In fact you need to have 2 pointers, but going the same way. Something like this: int tail=0; for(i=0;i<nums.size;i++){ if(nums[i]!=val) { if(tail!=i) nums[tail]=nums[i]; tail++; } } return tail;

  • @ynh148
    @ynh1483 сағат бұрын

    This channel is the best thing I have ever found on KZread shorts.

  • @49shivangtiwari52
    @49shivangtiwari523 сағат бұрын

    I think I know how to do this

  • @Ridgwaycer
    @Ridgwaycer4 сағат бұрын

    Are we supposed to believe companies are giving questions which can be solved by baby's first for loop?

  • @brandonsager223
    @brandonsager2234 сағат бұрын

    Be the stakeholder

  • @mailtochung
    @mailtochung5 сағат бұрын

    Isn't this still O(n)? You still have to loop through all elementes

  • @pptmtz
    @pptmtz6 сағат бұрын

    This does not work. I'm testing this with some basic new inputs, and it fails a lot

  • @planktonfun1
    @planktonfun16 сағат бұрын

    Dijkstra's algorithm is a dynamic programming code now? Who keep making these up

  • @purplecatfishz2112
    @purplecatfishz21126 сағат бұрын

    Your solution doesn't even return anything. You also didn't include the in over half part of the problem which without it your solution doesn't work in all lists.

  • @fspieler
    @fspieler7 сағат бұрын

    if len(Words) != len(S): return False return all(it[0][0] == it[1] for it in zip(Words, S))

  • @brycejohansen7114
    @brycejohansen71149 сағат бұрын

    You could use Newton's Method which is O(log log n) because it converses quadratically.

  • @lambda653
    @lambda6539 сағат бұрын

    Linear regression is an incredibly simple algorithm, that is not proper machine learning the way we think of chatGPT and DALL-E! Anybody that knows calculus and very basic linear algebra can learn linear regression in a couple weeks, the actual hard part of machine learning is when the problem is difficult enough to warrant an algorithm that requires training. It's understanding how a neural network is optimized, or how a transformer works, or what diffusion is, that's the part of machine learning that has all the opportunities, and you really do have to go to school to learn that. This stuff for comparison is something that is taught in high schools even. It's quite literally something you can teach to a teenager.

  • @ULTIMARAGNAR0K
    @ULTIMARAGNAR0K9 сағат бұрын

    Absolute novice. I do all my leetcode in C

  • @crawlingrocket116
    @crawlingrocket1169 сағат бұрын

    In the real world I would use an array for storing the counts of each letter. But just for fun I implemented a solution that packs the counters into a 128-bit integer. Works splendidly as long as no character appears more than 15 times in a word. Anyway, I'm not sure it gave me any extra performance.

  • @asimshah1824
    @asimshah182411 сағат бұрын

    Int I = 0 For(String x: words){if(x[0]!=s[i++]){return false} Return true

  • @PhonesUnboxing
    @PhonesUnboxing11 сағат бұрын

    I wish I get this question in an interview 😂

  • @user-xi7lg3em8i
    @user-xi7lg3em8i12 сағат бұрын

    Really clear explanation, thank you so much! keep up the good work

  • @LelouchVDK
    @LelouchVDK12 сағат бұрын

    I might be dumb, but putting it on the internet anyway. But wouldn't any square of an integer larger than the half of the original number already be bigger than the original number, meaning you could set the initial range to be from 1 to num // 2. Either way amazing question with an awesome solution from you

  • @user-vs5rh1oz3w
    @user-vs5rh1oz3w12 сағат бұрын

    please explain leetcode's "LAST DAY WHERE YOU CAN STILL CROSS" or "MINIMUM COST TO MAKE ARRAY EQUAL"

  • @GasMoonK3B
    @GasMoonK3B12 сағат бұрын

    who else is here after watching porn?

  • @jvcss
    @jvcss12 сағат бұрын

    I would like at least to pass to the technical interview. Can you share your advices for a stunning resume?

  • @pastori2672
    @pastori267212 сағат бұрын

    step 1: get an interview at uber

  • @balltomessi8515
    @balltomessi851512 сағат бұрын

    3 minutes ago is also crazy

  • @Xagittarius
    @Xagittarius12 сағат бұрын

    Cloud you guide a zigzag conversation

  • @alansun697
    @alansun69712 сағат бұрын

    11s ago is crazy

  • @GregHogg
    @GregHogg12 сағат бұрын

    Thank you so much for watching the video! Drop a like if you found this helpful, and subscribe to see these in your feed daily :)

  • @Wojtek_Sech
    @Wojtek_Sech13 сағат бұрын

    me: return 5;

  • @RajinderSingh-tm8ln
    @RajinderSingh-tm8ln14 сағат бұрын

    In which programming language he is coding?

  • @MikeWmusic10
    @MikeWmusic1014 сағат бұрын

    Is this all just for prepping for the coding questions at interview? I can't imagine actually putting this on a resume/cv

  • @skejeton
    @skejeton15 сағат бұрын

    just use square root

  • @asagiai4965
    @asagiai496516 сағат бұрын

    I just noticed something here. People, if you please stop making Stack other than a Stack. It's fine to implement your own Stack. But it should work as one. (LIFO) Sometimes, a DS is not about performance or accessibility but how it works.

  • @InfinityCS77
    @InfinityCS7716 сағат бұрын

    A = N ** ½ if A % 1 == 0: print(N, 'is a perfect square') else: print(N, 'is not a perfect square')

  • @AnshSingh-dk5uu
    @AnshSingh-dk5uu16 сағат бұрын

    First method isn’t correct..array can have repeating elements

  • @asagiai4965
    @asagiai496516 сағат бұрын

    But the problem is that linkedlist is not a stack. It can work like one. But I don't think it shouldn't be treated as the same.

  • @ajitsdeshpande
    @ajitsdeshpande17 сағат бұрын

    Hi Greg, thank you for all the efforts in explaining and coding the solutions which have helped me learn. All the Best!👍

  • @GregHogg
    @GregHogg14 сағат бұрын

    Wow! Thank you so much! That's so nice of you :) 🥰

  • @abdfn1169
    @abdfn116917 сағат бұрын

    Just explain the algorithm , when we have to understand from the code it is difficult in such a short time but the algo can be understood

  • @b_m_b9030
    @b_m_b903019 сағат бұрын

    what website is this

  • @AnshSingh-dk5uu
    @AnshSingh-dk5uu20 сағат бұрын

    But every local variable gets popped from the call stack after return statement is called so it shouldn’t take any space at the end right ? Correct me if I am wrong

  • @lukeaura588
    @lukeaura58821 сағат бұрын

    if there are only 2 possible values you can use partition and take the middle element. if there are more than two possible elements, your solution doesn't work

  • @TheJmax04
    @TheJmax0421 сағат бұрын

    (The recursive algorithm is not a backtracking algorithm)

  • @user-dv2et9ij3z
    @user-dv2et9ij3z21 сағат бұрын

    Wave Li algotithm

  • @thequang9234
    @thequang923423 сағат бұрын

    nice

  • @XPkoolXD
    @XPkoolXD23 сағат бұрын

    this question will determine if you make 100k+ or 0. Risk it all on yes :) (fuck tech companies! lets unionize!)

  • @raimondszakis8337
    @raimondszakis8337Күн бұрын

    IndexOf(sad) or am I missing something

  • @vaibhavsharma2060
    @vaibhavsharma2060Күн бұрын

    93 rn 4 hard 46medium 43 easy

  • @scorproy123
    @scorproy123Күн бұрын

    Beauty

  • @mad_bad_cat
    @mad_bad_catКүн бұрын

    Proper way is a trie. That’s basically T9 input from old mobile phone days.

  • @Rexxar677
    @Rexxar677Күн бұрын

    If the sqrt is not allowed simply use the representation of a sqrt which will always be ^(1/2), by doing so and validating if the number is a int, it’ll beat that since its complexity is O(1)