LEETCODE 47 (JAVASCRIPT) | PERMUTATIONS II

Sdílet
Vložit
  • čas přidán 9. 05. 2021
  • Hey everyone. Check out this in-depth solution for leetcode 47.

Komentáře • 8

  • @waheedahmed6602
    @waheedahmed6602 Před rokem

    Amazing Content, Andy!

  • @mohammednishad4055
    @mohammednishad4055 Před 3 lety

    your explanation is so simple, post all questions in the leetcode. I subscribed and shared it with my friends. I got your channel when I search permutation 11 leatcode javascript, and first few videos I didn't understand anything and I watched every video below and got your's one and I understand better from your video and subscribed

  • @shuangwu1615
    @shuangwu1615 Před 2 lety

    Hey Andy, thank you so so much for the video!!! I'm a beginner to algorithms and your videos helped so much

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

      if u compare nums[ j-1 ] and nums[ j ], you only compare two adjacent numbers. What if [ j ] is equal to [ j - 2] ? what if [ j ] is equal to [ j - 3]? etc. If [ j ] is equal to [ j - 2], all the recursion with j would be not necessary as well. To make sure you don't have [ j ] that not repeat with any previous number, you need to use a hash to store all previous [ j ] and check them

  • @ec5988
    @ec5988 Před 3 lety

    Hey man just wanted to drop a comment and say it should illegal to not make this mandatory viewing. the diagram is great, though I can't follow the code, will attempt to rewatch
    would be killer if u could share the code somewhere

    • @andygala888
      @andygala888  Před 3 lety

      Thank E C! Keep rewatching. It'll eventually click.