Leetcode 1335 Minimum Difficulty of a Job Schedule | Coding Decoded SDE Sheet

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ย. 2024

ความคิดเห็น • 26

  • @abilashshankarpalli9301
    @abilashshankarpalli9301 2 ปีที่แล้ว +6

    If there was recursion tree included in the video it would have been great to understand it easily

  • @Dineshkumar_dk
    @Dineshkumar_dk 10 หลายเดือนก่อน

    if jd.length=6 and days=2, then the for loop will goes up to 6-2+1. so, 0 to less then 3. then the last three values would not be taken,but the given total days is 2 only. can u explain this?

  • @rohangangwar6604
    @rohangangwar6604 2 ปีที่แล้ว

    can we say this is based on DP on partitions ??

  • @NeverGiveUp186
    @NeverGiveUp186 2 ปีที่แล้ว

    The time complexity would be O(n^2 * d) right ?

  • @sourin.majumdar
    @sourin.majumdar 2 ปีที่แล้ว

    is this the latest look of leetcode for only mac os?

  • @GeniuslyTensai
    @GeniuslyTensai 2 ปีที่แล้ว

    is this question an example of matrix chain multiplication or partition dp?

  • @hardikgupta7924
    @hardikgupta7924 2 ปีที่แล้ว

    what is the time and space complexity of this approach

  • @gautamgoel2024
    @gautamgoel2024 2 ปีที่แล้ว

    godly solution.

  • @sourin.majumdar
    @sourin.majumdar 2 ปีที่แล้ว

    what is the time and space complexity

  • @Mohit-yt7up
    @Mohit-yt7up 2 ปีที่แล้ว

    Very Good Explanation sir 😁

  • @code-a-mania4100
    @code-a-mania4100 2 ปีที่แล้ว

    bhaiya u r consistancy become my consistancy!! thank u so much🙃🙂

    • @David-mk8kh
      @David-mk8kh 2 ปีที่แล้ว

      Hi , can you suggest me from where can I lean DSA. I didn't understand the solution in the video, I am a beginner.

    • @santoshvarma996
      @santoshvarma996 2 ปีที่แล้ว

      @@David-mk8kh is you understand hindi there a DP series by Aditya Verma, that makes dp easy to understand

    • @David-mk8kh
      @David-mk8kh 2 ปีที่แล้ว

      @@santoshvarma996 yes I will go through it . Thank you. Plz mention any other sources from which you prepared, if any? It will really help

    • @santoshvarma996
      @santoshvarma996 2 ปีที่แล้ว

      @@David-mk8kh I have learnt basics of DP from those videos, he explained them gradually building concepts, that was only thing i referred to learn and then i just practiced problems with the help of this channel.

  • @harshalyallewar
    @harshalyallewar 2 ปีที่แล้ว

    this solution is little difficult to understand , so i have given my solution may be it is helpful and understandable by others

    • @harshalyallewar
      @harshalyallewar 2 ปีที่แล้ว

      //Recursive solution With Memoization
      public int f(int[] jobDifficulty,int i, int d, int max, Integer [][] dp) {
      if(i==jobDifficulty.length && d==0){
      return 0;
      }
      if(i==jobDifficulty.length || d==0){
      return (int)10e4+1;
      }
      if(dp[i][d][max]!=null) return dp[i][d][max];
      max = Math.max(max, jobDifficulty[i]);
      //options to explore ways
      int way1 = max + f(jobDifficulty, i+1, d-1 ,0 , dp);
      //we are done on d day so move on to next day but we have to add max which we were maitaining

      int way2 = f(jobDifficulty, i+1, d, max, dp);
      //be on the same day and we are maitaining max
      return dp[i][d][max] = Math.min(way1,way2);
      }

    • @ITACHIUCHIHA-dr8sz
      @ITACHIUCHIHA-dr8sz 2 ปีที่แล้ว +1

      @@harshalyallewar Bottom up Dp for reference ->
      int minDifficulty(vector&difficulty, int d) {
      int n = difficulty.size();
      if(d > n)
      return -1;

      vectordp(n + 1, vector(d + 1, 1e8));
      dp[n][0] = 0;

      for(int i = n - 1; i >= 0; i--){
      for(int day = 0; day = 0)
      dp[i][day] = min(dp[i][day], dp[j + 1][day - 1] + mx);
      }
      }
      }

      return dp[0][d];
      }

    • @harshalyallewar
      @harshalyallewar 2 ปีที่แล้ว

      @@ITACHIUCHIHA-dr8sz nice

  • @Khabibullah
    @Khabibullah 2 ปีที่แล้ว

    10:32 Is there any extension that changes leetcode UI?

    • @cutieenushkiee1169
      @cutieenushkiee1169 2 ปีที่แล้ว

      It’s the new update on leetcode

    • @GeniuslyTensai
      @GeniuslyTensai 2 ปีที่แล้ว

      @@cutieenushkiee1169 I guess not everyone is getting the update?

  • @praffulshukla4576
    @praffulshukla4576 2 ปีที่แล้ว +1

    dude u r just reading code , WHY U R IN SO HURRY

    • @nishankpriydarshi3984
      @nishankpriydarshi3984 2 ปีที่แล้ว

      the code is easy to understand once the intuition is clear imo

    • @lakshayrastogi7640
      @lakshayrastogi7640 2 ปีที่แล้ว +1

      @@nishankpriydarshi3984 why the loop is running till