Domino and Tromino Tiling | Leetcode 790 | Live coding session 🔥🔥🔥🔥| Dynamic Programming Approach

Поділитися
Вставка
  • Опубліковано 28 жов 2024

КОМЕНТАРІ • 31

  • @praveenj3112
    @praveenj3112 2 роки тому +8

    it's very hard to come up with the solution at first glance for problems like this.

  • @christrifinopoulos8639
    @christrifinopoulos8639 10 місяців тому +1

    The step by step explanation was amazing. I would understand it even if I had no idea about algorithms and DP. good job!!!

  • @vinayakgupta1
    @vinayakgupta1 2 роки тому +6

    For N= 4. The number of ways Tromino Tile + Domino Tile combinations can be 4, TD(upper empty space)T, TD(lower empty space)T, TTD, DDT, correct ?

    • @tanson86
      @tanson86 Рік тому +4

      For N=4 the result is 11 ie 5 (only dominoes) + 6 ( domino and tromino ). Correct me if I am wrong.

  • @devesh_official_
    @devesh_official_ 2 роки тому +2

    Sir you have multiplied by 2 after n-3 because for every case two possible ways are coming right??

    • @CodeWithSunchitDudeja
      @CodeWithSunchitDudeja  2 роки тому +1

      Yes exactly the result of n-3 can be used in 2 ways using tromino

    • @devesh_official_
      @devesh_official_ 2 роки тому +1

      @@CodeWithSunchitDudeja Thank you sir for reply ....your explanations are seriously worthy ...liked it

  • @pavniujla654
    @pavniujla654 2 роки тому +3

    Best one on google! thnx.

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

    when n==4 then why can not we place one L then inverted L and then a vertical domino tile ?

  • @bloody9162
    @bloody9162 2 роки тому +1

    This is a very very good question I'd say and I'll recommend everyone to pick up pen and paper to come to the conclusion behind the 2 that is being multiplied to every term starting f(n-3). There are a lot of concepts involved here. The crux is that you don't want to jump to the condition that is already being taken care of in the base cases (f(1), f(2) and f(3)).

  • @aditisrivastava6499
    @aditisrivastava6499 2 роки тому +2

    Your explanations never disappoint. Thankyou

  • @satanshuag
    @satanshuag 2 роки тому +1

    how to grab above approach quickly :
    1 ) watch full video understand it.
    2) time take a book and dry run along with him.
    3) Code yourself after understanding.

  • @harshitsaluja3493
    @harshitsaluja3493 2 роки тому

    We are removing duplicates when N=2 while calculating equations but for N-3 and N-4 we are not. Does not seems to be logical to me

  • @pogo7052
    @pogo7052 2 роки тому +3

    Wonderful explanation...
    Your efforts are commendable

    • @CodeWithSunchitDudeja
      @CodeWithSunchitDudeja  2 роки тому +2

      Thank, however in past over one and half years I have published 432 videos, have not got that much traction yet. These comments keep me moving.

    • @pogo7052
      @pogo7052 2 роки тому +2

      @@CodeWithSunchitDudeja Yes sir, I am a frequent viewer of your videos. Whenever I m unable to come up with an optimized solution of any LC problem, irrespective of daily challenge, your explanation is there for rescue. xD
      Moreover, I am even in your LinkedIn connection.
      Thanks for making these contents despite your daily professional life...

    • @jay-rathod-01
      @jay-rathod-01 2 роки тому

      @@CodeWithSunchitDudeja probably new users are increasing but people only visit this channel when they really are not able to solve hence...

  • @jay-rathod-01
    @jay-rathod-01 2 роки тому +3

    I pray to god these kinda questions don't pop in my interview. Btw how on earth do ya'll think soooo deeep mathematically. Isme DP kam math zyaada use hui hai.

  • @KousthubhaKumar
    @KousthubhaKumar 2 роки тому +1

    Great explanation, thank you! looking forward to more videos from this channel!

  • @krateskim4169
    @krateskim4169 Рік тому +1

    Awesome explanation

  • @nicolattu
    @nicolattu 2 роки тому +2

    great explanation ! it was not easy to understand

  • @omnamahshivaya2054
    @omnamahshivaya2054 2 роки тому +2

    dp[n-2]+dp[n-3]+2*(dp[n-4]+...+dp[0]) = dp[n-1], Can anybody please help me to understand it?

    • @jay-rathod-01
      @jay-rathod-01 2 роки тому +1

      wapas video dekh samajh aajaayega.

    • @bhargav4g538
      @bhargav4g538 2 роки тому +2

      Bro keep n-1 in n in the expression dp(n) and check ====> dp(n) becomes dp(n-1) and all rhs go from n to n-1

    • @ashishvaishnav7005
      @ashishvaishnav7005 2 роки тому

      @@bhargav4g538 Thanks!!

  • @StellasAdi18
    @StellasAdi18 2 роки тому +1

    Dear lord. Who asks such Q in SW interview 😢.