Andy Gala
Andy Gala
  • 101
  • 526 598

Відео

LEETCODE 199 (JAVASCRIPT) | BINARY TREE RIGHT SIDE VIEW
Переглядів 2,9 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 199.
LEETCODE 285 (JAVASCRIPT) | INORDER SUCCESSOR IN BST
Переглядів 1,4 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 285.
LEETCODE 236 (JAVASCRIPT) | LOWEST COMMON ANCESTOR OF A BINARY TREE
Переглядів 3,9 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 236.
LEETCODE 113 (JAVASCRIPT) | PATH SUM II
Переглядів 2,8 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 113.
LEETCODE 112 (JAVASCRIPT) | PATH SUM
Переглядів 3,2 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 112.
LEETCODE 429 (JAVASCRIPT) | N-ARY TREE LEVEL ORDER TRAVERSAL
Переглядів 2,4 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 429.
LEETCODE 701 (JAVASCRIPT) | INSERT INTO A BINARY SEARCH TREE
Переглядів 1,6 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 701.
LEETCODE 543 (JAVASCRIPT) | DIAMETER OF BINARY TREE
Переглядів 3,5 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 543.
LEETCODE 108 (JAVASCRIPT) | CONVERT SORTED ARRAY TO BINARY SEARCH TREE
Переглядів 4,7 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 108.
LEETCODE 250 (JAVASCRIPT) | COUNT UNIVALUE SUBTREES
Переглядів 2,1 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 250.
LEETCODE 105 (JAVASCRIPT) | CONSTRUCT BINARY TREE FROM PREORDER AND INORDER TRAVERSAL
Переглядів 3,2 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 105.
LEETCODE 103 (JAVASCRIPT) | BINARY TREE ZIGZAG LEVEL ORDER TRAVERSAL
Переглядів 2 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 103.
LEETCODE 107 (JAVASCRIPT) | BINARY TREE LEVEL ORDER TRAVERSAL II
Переглядів 1,6 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 107.
LEETCODE 144 (JAVASCRIPT) | BINARY TREE PREORDER TRAVERSAL
Переглядів 4,6 тис.3 роки тому
Hey everyone. Check out this in-depth solution for leetcode 144.
LEETCODE 102 (JAVASCRIPT) | BINARY TREE LEVEL ORDER TRAVERSAL
Переглядів 7 тис.3 роки тому
LEETCODE 102 (JAVASCRIPT) | BINARY TREE LEVEL ORDER TRAVERSAL
LEETCODE 784 (JAVASCRIPT) | LETTER CASE PERMUTATION
Переглядів 8 тис.3 роки тому
LEETCODE 784 (JAVASCRIPT) | LETTER CASE PERMUTATION
LEETCODE 17 (JAVASCRIPT) | LETTER COMBINATIONS OF A PHONE NUMBER
Переглядів 5 тис.3 роки тому
LEETCODE 17 (JAVASCRIPT) | LETTER COMBINATIONS OF A PHONE NUMBER
LEETCODE 51 & 52 (JAVASCRIPT) | N QUEENS I & II
Переглядів 3,1 тис.3 роки тому
LEETCODE 51 & 52 (JAVASCRIPT) | N QUEENS I & II
LEETCODE 47 (JAVASCRIPT) | PERMUTATIONS II
Переглядів 3,2 тис.3 роки тому
LEETCODE 47 (JAVASCRIPT) | PERMUTATIONS II
LEETCODE 131 (JAVASCRIPT) | PALINDROME PARTITIONING I
Переглядів 2,1 тис.3 роки тому
LEETCODE 131 (JAVASCRIPT) | PALINDROME PARTITIONING I
LEETCODE 46 (JAVASCRIPT) | PERMUTATIONS I
Переглядів 13 тис.3 роки тому
LEETCODE 46 (JAVASCRIPT) | PERMUTATIONS I
LEETCODE 78 (JAVASCRIPT) | SUBSETS I
Переглядів 7 тис.3 роки тому
LEETCODE 78 (JAVASCRIPT) | SUBSETS I
LEETCODE 494 (JAVASCRIPT) | TARGET SUM
Переглядів 1,9 тис.3 роки тому
LEETCODE 494 (JAVASCRIPT) | TARGET SUM
LEETCODE 22 (JAVASCRIPT) | GENERATE PARENTHESES
Переглядів 4,8 тис.3 роки тому
LEETCODE 22 (JAVASCRIPT) | GENERATE PARENTHESES
LEETCODE 90 (JAVASCRIPT) | SUBSETS II
Переглядів 2,9 тис.3 роки тому
LEETCODE 90 (JAVASCRIPT) | SUBSETS II
LEETCODE 40 (JAVASCRIPT) | COMBINATION SUM II
Переглядів 3,1 тис.3 роки тому
LEETCODE 40 (JAVASCRIPT) | COMBINATION SUM II
LEETCODE 216 (JAVASCRIPT) | COMBINATION SUM III
Переглядів 3 тис.3 роки тому
LEETCODE 216 (JAVASCRIPT) | COMBINATION SUM III
LEETCODE 39 (JAVASCRIPT) | COMBINATION SUM I
Переглядів 4,9 тис.3 роки тому
LEETCODE 39 (JAVASCRIPT) | COMBINATION SUM I
LEETCODE 509 (JAVASCRIPT) | FIBONACCI NUMBER
Переглядів 2,3 тис.3 роки тому
LEETCODE 509 (JAVASCRIPT) | FIBONACCI NUMBER

КОМЕНТАРІ

  • @shoummorauth
    @shoummorauth 6 днів тому

    Great explanation. I still wonder why that Pos was given so much importance there in the the problem?

  • @atHomeNYC
    @atHomeNYC 16 днів тому

    Amazing explanation, thank you.

  • @rahulthilak3730
    @rahulthilak3730 Місяць тому

    which whiteboard tool do you use?

  • @Samiullah-vd6sm
    @Samiullah-vd6sm Місяць тому

  • @ummarfarooqpk
    @ummarfarooqpk Місяць тому

    Got the logic, thanks 👍

  • @kidsfun5703
    @kidsfun5703 Місяць тому

    I think recursively is easier

  • @kidsfun5703
    @kidsfun5703 Місяць тому

    I practiced it more than 10 times now I can solve in a heartbeat in different ways

  • @Olayiwolaibrahim-rh2rh
    @Olayiwolaibrahim-rh2rh Місяць тому

    how can leetcode regard this as easy

  • @misha_yt5419
    @misha_yt5419 Місяць тому

    Great video!!!

  • @chiomaubogagu7732
    @chiomaubogagu7732 2 місяці тому

    unreal explanation! thank you for the clarity!!

  • @osamahussam4351
    @osamahussam4351 2 місяці тому

    Really appreciated, this channel is a treasure for everyone willing to master problem solving! I hope U back soon and continue teaching us these amazing techniques

  • @osamahussam4351
    @osamahussam4351 3 місяці тому

    appreciated! actually it's amazing content, that's insane .. thx a lot for your effort

  • @sk45861
    @sk45861 3 місяці тому

    Small request, please use night mode, otherwise it's difficult to read

  • @cjb5748
    @cjb5748 3 місяці тому

    Simply checking if the value at buy index is greater than value at sell index seems a bit more intuitive to me, as the goal is to get the high sell value to the right of the buy index. var maxProfit = function(prices) { let buy = prices.length - 1; let sell = prices.length - 1; let profit = 0; while(buy > 0 && sell > 0){ if(prices[buy] > prices[sell]){ sell = buy; } else { buy--; profit = Math.max(profit, prices[sell] - prices[buy]); } } return profit; };

  • @thethirddan
    @thethirddan 3 місяці тому

    can't you also set negative numbers at the index, and if you come across a negative value, that's the dupe?

  • @j.villasmil9575
    @j.villasmil9575 3 місяці тому

    The second swap throws me this error: [nums[i], nums[j]] = [nums[j], nums[i]] ^ TypeError: Cannot set properties of undefined (setting '3')

  • @ZaidanLujino
    @ZaidanLujino 3 місяці тому

    Why is it 9? Isnt that the max left and right + 1? then isnt that shoud be 6?

  • @IshaZaka
    @IshaZaka 3 місяці тому

    Thankyou so much for creating these videos, these are so helpful

  • @noorb374
    @noorb374 3 місяці тому

    Hi Andy, Plz make more in js, you explaination is very good and easily understandable

  • @daveonline1
    @daveonline1 3 місяці тому

    Time Limit Exceeded

  • @jerryliu862
    @jerryliu862 4 місяці тому

    Awesome, thank you

  • @patrickcameron2950
    @patrickcameron2950 4 місяці тому

    Using a string to check parenthesis pairs is very clever. I would have jumped straight to making a hash map without considering simpler options.

  • @luiscarlosjayk
    @luiscarlosjayk 4 місяці тому

    Andy, what's the book you recommend to learn all the graphs concepts you mention? See, I have the issue that I have plenty of experience with building distributed services, serverless, APIs, databatases, infrastructure, etc, etc, but, in interviews I usually always fail because they request these types of algorithms problems that I just don't know how to traverse and that puts me down. I'm a self taught person, I didn't graduate as a software engineer as others might have so I didn't see graphs theory of anything of that at a university, just learned what the market was demanding for a job, and it feels bad that I cannot pass interviews because of these.

  • @luiscarlosjayk
    @luiscarlosjayk 4 місяці тому

    Andy, what's the book you recommend to learn all the graphs concepts you mention? See, I have the issue that I have plenty of experience with building distributed services, serverless, APIs, databatases, infrastructure, etc, etc, but, in interviews I usually always fail because they request these types of algorithms problems that I just don't know how to traverse and that puts me down. I'm a self taught person, I didn't graduate as a software engineer as others might have so I didn't see graphs theory of anything of that at a university, just learned what the market was demanding for a job, and it feels bad that I cannot pass interviews because of these.

  • @fatimaiqra2169
    @fatimaiqra2169 4 місяці тому

    Thanks

  • @deepanncool2631
    @deepanncool2631 4 місяці тому

    what is the whiteboard app name which you were using to draw the dfs tree?

  • @asadbek_iv
    @asadbek_iv 4 місяці тому

    thanks for you,your solution deserves much more elegant

  • @sky9k-unlimited
    @sky9k-unlimited 4 місяці тому

    You make things extremely overcomplicated for literally no reason man. For example, sofar should be named as maxSum or currentSum etc. If you can't even name something properly then it is only going to confuse everyone. For the max, you could have written maxAverage, finalAverage, etc. Nobody is going to know what you are naming what for what. Learn basic naming sense dude.

    • @thiagosdev
      @thiagosdev 2 місяці тому

      I was redoing this problem, and yeah it is a little overcomplicated.

  • @ayushsharma8378
    @ayushsharma8378 4 місяці тому

    no need to sort the input array

  • @sushmitgaur8537
    @sushmitgaur8537 4 місяці тому

    some people using recursion or while(true) approach and yours has prev. which one is better?

  • @jerryliu862
    @jerryliu862 4 місяці тому

    The best solution I've ever seen; it's better than AI answers. Great explanation

  • @antonellosanna-j1f
    @antonellosanna-j1f 4 місяці тому

    Easiest medium leetcode exercise I have seen so far, not sure if they forgot to add some test cases?, it passes even with just this: const findPeakElement = nums => nums.indexOf(Math.max(...nums));

  • @bidaarle
    @bidaarle 4 місяці тому

    This is a dope solution. How do you even think of that

  • @jonathanleibovici9988
    @jonathanleibovici9988 5 місяців тому

    can you show me how to also do it with hash or sets please.

  • @ELAAD2408
    @ELAAD2408 5 місяців тому

    best teacher for leetcode in youtube

  • @Fido1hn
    @Fido1hn 5 місяців тому

    Thanks so much

  • @Probablyaliq4
    @Probablyaliq4 5 місяців тому

    Thank you very much

  • @izazk
    @izazk 5 місяців тому

    Simple solution: /** * @param {number[]} nums * @param {number} k * @return {void} Do not return anything, modify nums in-place instead. */ var rotate = function (nums, k) { k = k % nums.length; nums = nums.slice(-k).concat(nums.slice(0, -k)); };

  • @Codingchess-rw7sp
    @Codingchess-rw7sp 5 місяців тому

    Please continue the series sir more leetcode solution please

  • @viralpasad5222
    @viralpasad5222 5 місяців тому

    I wish the helper functions would've been explained more, you just built upon the fact that everyone has read the book.

  • @thiernodem5681
    @thiernodem5681 6 місяців тому

    I understands codes more when it's been coded than explained on paper or board. You explained it very well, and it's actually easy to comprehend. Thank you!

  • @Taiwaneze
    @Taiwaneze 6 місяців тому

    thats was soo poorly explained

  • @rehamgamal1722
    @rehamgamal1722 7 місяців тому

    the audio is so low I can't hear you. but great job!

  • @itsokaytobesergey
    @itsokaytobesergey 8 місяців тому

    left + (right - left) === right

  • @muhammednehyan5443
    @muhammednehyan5443 8 місяців тому

    great explanation

  • @rrl9786
    @rrl9786 8 місяців тому

    Man, thank you so much. I am beginning to get pretty comfortable with linked lists, but this problem turned my brain into mush and I finally decided it was better to just see it demonstrated and then use that knowledge in future problems. Your explanation was so clear and concise, I finally actually understand this fully.

  • @TheKylesampson
    @TheKylesampson 8 місяців тому

    Best vid I found today for understanding quick sort. Thank you!

  • @sportsmanship2024
    @sportsmanship2024 8 місяців тому

    I hardly heard your voice, I don't know if it is from your microphone or you are not speaking louder...

  • @SouravCheck
    @SouravCheck 8 місяців тому

    hello, /** * @param {string} s * @return {boolean} */ var isValid = function(s) { let input=s.split(""); let count=0; for(let i=0;i<input.length;i++) { for(let j=i+1;j<input.length;j++) { if(input[i]=='('&& input[j]==')' || input[i]=='[' && input[j]==']' || input[i]=='{'&& input[j]=='}') { count++; } if( input[i]=='(' && input[j+1]==')' || input[i]=='{' && input[j+1]=='}' ||input[i]=='[' && input[j+1]==']') { return false; } } } if((count*2)==input.length) { return true; } else { return false; } };

    • @SouravCheck
      @SouravCheck 8 місяців тому

      why it is not running.....................

  • @Ly-fj3dq
    @Ly-fj3dq 9 місяців тому

    thank you so much for this video!!!! helps me a lot