Find All Numbers Disappeared in an Array - LeetCode 448 - Python [O(n) time and O(1) Space!]

Sdílet
Vložit
  • čas přidán 14. 01. 2020
  • If this HELPED at all, check out my channel for even **MORE VIDEOS**!!:)) czcams.com/users/DEEPTITALES...
    Explaining how to solve Find All Numbers Disappeared in an Array in Python - LeetCode 448!
    Music: Bensound
    Code: github.com/deepti-talesra/Lee...
    Let me know if you have any questions!:)
  • Věda a technologie

Komentáře • 40

  • @BriitStiick
    @BriitStiick Před 3 měsíci +1

    this is the best walkthrough of this problem, thanks!

  • @AkashSharma-lf5jq
    @AkashSharma-lf5jq Před 6 měsíci +2

    finally I found the best approach for this question.Thanks !!!

  • @joncavalliemester
    @joncavalliemester Před 3 lety +4

    Thank you, greatest and most simple explanation I could find anywhere!

  • @pratyaksh52
    @pratyaksh52 Před 3 lety +2

    I finally understood this now, thank you so much!!

  • @anmolwadali9227
    @anmolwadali9227 Před 3 lety +1

    GREAT EXPLANATION!!!!! KEEP POSTING MORE SUCH QUESTIONS !!

  • @mike19558
    @mike19558 Před 2 lety

    Concise and useful explanation, much appreciated!

  • @DipanjalMaitra
    @DipanjalMaitra Před 2 lety

    awesome, thanks a lot, this thought process has already unlocked some other array problems like
    "finding the duplicate numbers in an array" and so on. but what if the array was immutable?

  • @gopalsingh-uc3bx
    @gopalsingh-uc3bx Před 4 lety +1

    nice explanation, made it easy to understand

  • @yunalee9036
    @yunalee9036 Před 4 lety

    Very nice! Can you kindly let me know what algorithm you use for solving this problem? I would like a further research.

    • @DEEPTITALESRA
      @DEEPTITALESRA  Před 4 lety +1

      Thank you! I'm not sure if there is a name for this type of approach, or if there is, I'm not aware of it. If I do find out more however, I'll comment below!

  • @ravimaurya590
    @ravimaurya590 Před 4 lety +1

    Excellent Logic.

  • @yasmeenkarachiwala9612

    Amazing!

  • @deepshah4933
    @deepshah4933 Před 2 lety

    amazing explanation

  • @tanishgupta4543
    @tanishgupta4543 Před 2 lety

    i loved the way you teach mam

  • @HarshySZN
    @HarshySZN Před 4 lety

    Here's how I implemented in java if someone is using java (very good explanation btw)
    class Solution {
    public List findDisappearedNumbers(int[] nums) {
    List list = new ArrayList();

    for(int i = 0; i < nums.length; i++){
    int pos = Math.abs(nums[i])-1;
    nums[pos] = -Math.abs(nums[pos]);
    }

    for(int i = 0; i < nums.length; i++){
    if(nums[i] >= 0) list.add(i+1);
    }
    return list;
    }
    }
    Runtime: 5 ms, faster than 83.36% of Java online submissions for Find All Numbers Disappeared in an Array.
    Memory Usage: 48.2 MB, less than 37.74% of Java online submissions for Find All Numbers Disappeared in an Array.

  • @aniketninawe1228
    @aniketninawe1228 Před 3 lety +1

    great! we need more videos :)

  • @prathameshp3949
    @prathameshp3949 Před 4 lety +2

    Hey, great explanation and logic. Just a little suggestion, if you are creating a logic or using a specific algorithm, can you use comments to highlight which part of code executes specific logic. Also as you started this channel sometime back, maybe a github repo to maintain code and explanation for further reading can be great help. Thanks. Also you can use enumerate(iterable, start=1) to go through indices that start from 1 instead of 0.

    • @DEEPTITALESRA
      @DEEPTITALESRA  Před 4 lety

      Thank you! I’ll look into documenting the code somehow, repo or otherwise (maybe in the description?). And yeah doing enumerate starting from 1 would make it clearer!

    • @DEEPTITALESRA
      @DEEPTITALESRA  Před 3 lety

      just for Prathamesh: github.com/deepti-talesra/LeetCode
      all my code uploaded on github - hope this makes it easier and helps:)

    • @prathameshp3949
      @prathameshp3949 Před 2 lety

      @@DEEPTITALESRA Thanks, is it okay to contribute? Definitely can help it look more readable with explanation and other text?

  • @cocoarecords
    @cocoarecords Před 3 lety

    intuitive and simple explanation srsly

  • @kushagrasen419
    @kushagrasen419 Před 3 lety

    can you plz do 289. Game of Life
    ?

  • @beingcheercool
    @beingcheercool Před 2 lety +1

    Zoom in the screen before teaching pls 🤗🤗

    • @DEEPTITALESRA
      @DEEPTITALESRA  Před 2 lety +1

      Haha yess def increasing font in newer vids!!:)