CodeCracker
CodeCracker
  • 54
  • 4 878
3301 Maximize the Total Height of Unique Towers
In this video we will solve today's Biweekly Contest 2nd problem which is "3301. Maximize the Total Height of Unique Towers".
Переглядів: 4

Відео

3300 Minimum Element After Replacement With Digit Sum
Переглядів 35 годин тому
In this video we will solve today's Biweekly Contest 1st problem which is " 3300. Minimum Element After Replacement With Digit Sum".
241 Different Ways to Add Parentheses
Переглядів 4121 годину тому
In this video we will solve today's Leetcode Daily Challenge problem which is "241. Different Ways to Add Parentheses".
179. Largest Number
Переглядів 17День тому
In this video we will solve todays Leetcode Daily Challenge problem which is "179. Largest Number".
539 Minimum Time Difference
Переглядів 21День тому
In this video we will solve today's Leetcode Daily Challenge problem which is "539. Minimum Time Difference".
3290 Maximum Multiplication Score
Переглядів 71День тому
In this video we will solve today's Leetcode Weekly Contest 415 second problem which is "3290. Maximum Multiplication Score".
The Two Sneaky Numbers of Digitville
Переглядів 59День тому
In this video we will solve today's Leetcode Weekly Contest second problem which is "The Two Sneaky Numbers of Digitville".
3286 Find a Safe Walk Through a Grid
Переглядів 21014 днів тому
In this video we will solve today's Biweekly Contest 139 second problem which is "3286. Find a Safe Walk Through a Grid".
Find Indices of Stable Mountains
Переглядів 3614 днів тому
In this video we will solve today's Leetcode Biweekly Contest first problem which is "Find Indices of Stable Mountains".
1310 XOR Queries of a Subarray | 2 Approaches | BruteForce | prefixXOR
Переглядів 1314 днів тому
In this video we will solve today's Leetcode Daily Challenge problem which is "1310. XOR Queries of a Subarray".
1684 Count the Number of Consistent Strings
Переглядів 2514 днів тому
In this video we will solve today's Leetcode Daily Challenge problem which is "1684. Count the Number of Consistent Strings".
Convert string
Переглядів 2514 днів тому
In this video we will solve today's codechef starters's 151 2nd problem which is "Convert string".
2220 Minimum Bit Flips to Convert Number
Переглядів 8014 днів тому
In this video we will be solving today's Leetcode Daily Challenge problem which is "2220. Minimum Bit Flips to Convert Number."
International Gym Day
Переглядів 20814 днів тому
In this video we will solve codechef contest Starter 151 div 3 first problem which is "International Gym Day."
Find the Key of the Numbers
Переглядів 5528 днів тому
In this video we will solve today's Leetcode Biweekly Contest 3rd problem which is "Find the Key of the Numbers".
3271 Hash Divided String
Переглядів 3228 днів тому
3271 Hash Divided String
3267. Count Almost Equal Pairs II
Переглядів 26Місяць тому
3267. Count Almost Equal Pairs II
3266 Final Array State After K Multiplication Operations II
Переглядів 69Місяць тому
3266 Final Array State After K Multiplication Operations II
3264 Final Array State After K Multiplication Operations I
Переглядів 44Місяць тому
3264 Final Array State After K Multiplication Operations I
3265 Count Almost Equal Pairs I
Переглядів 31Місяць тому
3265 Count Almost Equal Pairs I
B Minimize Equal Sum Subarrays
Переглядів 89Місяць тому
B Minimize Equal Sum Subarrays
A Find K Distinct Points with Fixed Center
Переглядів 53Місяць тому
A Find K Distinct Points with Fixed Center
840 Magic Squares In Grid
Переглядів 14Місяць тому
840 Magic Squares In Grid
Knockout tournament
Переглядів 1,2 тис.Місяць тому
Knockout tournament
3016 Minimum Number of Pushes to Type Word II
Переглядів 96Місяць тому
3016 Minimum Number of Pushes to Type Word II
2053 Kth Distinct String in an Array
Переглядів 34Місяць тому
2053 Kth Distinct String in an Array
Q1 Find the Number of Winning Players
Переглядів 136Місяць тому
Q1 Find the Number of Winning Players
Q2 Minimum Number of Flips to Make Binary Grid Palindromic I
Переглядів 37Місяць тому
Q2 Minimum Number of Flips to Make Binary Grid Palindromic I
1460 Make Two Arrays Equal by Reversing Subarrays
Переглядів 69Місяць тому
1460 Make Two Arrays Equal by Reversing Subarrays
2134 Minimum Swaps to Group All 1's Together II
Переглядів 29Місяць тому
2134 Minimum Swaps to Group All 1's Together II

КОМЕНТАРІ

  • @sourabhgarg2890
    @sourabhgarg2890 13 днів тому

    thanks in last i did dry run understand the optimal soln after fucking 1 hr :)

    • @NO-nc7hh
      @NO-nc7hh 13 днів тому

      😅yeah DP questions can be frustrating sometimes. glad you understand the concept.

  • @sourabhgarg2890
    @sourabhgarg2890 13 днів тому

    in simple soln when u put in set its means its visited right but when u backstracking then why not removig it ?

    • @NO-nc7hh
      @NO-nc7hh 13 днів тому

      I have passed set by value. so while backtracking the s{row, col} is removed from set. If i pass it by reference than i have to keep the track of health. because there could be a possibility that if you marked some index {2, 1} in set , my health is suppose 3 and i didn't find the path. than again using some other path i reach the same index {2, 1} and my health is suppose 6 this time. Than set({2,1}) will return 0 but there could be the possibilty if finding path . That's why it is imp to keep the track of health . so you can track the health by using 2d matrix, using map insead of set or 3d matrix that you have done in your code. You can dry run testcase 3 of the question grid = [[1,1,1],[1,0,1],[1,1,1]] health = 5 This will clear your doubt.

    • @sourabhgarg2890
      @sourabhgarg2890 13 днів тому

      @@NO-nc7hh yeah i use java, dont know how u pass it by value, its always by referncnce

    • @sourabhgarg2890
      @sourabhgarg2890 13 днів тому

      yeah i got the soln if its by value

  • @sourabhgarg2890
    @sourabhgarg2890 13 днів тому

    worst, u spend aall ur engry in order to explain simple things when complex part came then blah blah blah

    • @NO-nc7hh
      @NO-nc7hh 13 днів тому

      Which part u didn't understand?

    • @sourabhgarg2890
      @sourabhgarg2890 13 днів тому

      @@NO-nc7hh optmial soln , why u put dp[row][col] >= heath, u just explain it without dry run, in easy step u ddid all dry run

    • @NO-nc7hh
      @NO-nc7hh 13 днів тому

      ​@@sourabhgarg2890ok next time I'll try to put my point in an easier and much understandable way. Did you understand the code?

    • @sourabhgarg2890
      @sourabhgarg2890 13 днів тому

      @@NO-nc7hh i am using 3d visited[m][n][heath] its easy to understand

    • @NO-nc7hh
      @NO-nc7hh 13 днів тому

      @@sourabhgarg2890 okay. Is that accepted because using 3d vector might cause memory out of bound.

  • @Fowler9525
    @Fowler9525 29 днів тому

    Thanks for explanation

  • @SarveshChaurasia-pt3uo
    @SarveshChaurasia-pt3uo Місяць тому

    Nicely explained

  • @Harsh-sx4xv
    @Harsh-sx4xv Місяць тому

    A good observation based question

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

    ua-cam.com/video/4QcuS-gBOPE/v-deo.html

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

    Nice optimization bro. So, time complexity in worst case will still be O(N ^ 2) but in most cases, it will take less time than O(N^2), right?

    • @NO-nc7hh
      @NO-nc7hh 2 місяці тому

      Yes, you've got it right. In the worst case, the complexity is still O(n^2), but the optimization helps it perform better in many cases. Thanks for your comment.🙌

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

      @@NO-nc7hh No issues bro :) Btw, do you know some source for preparing questions/concepts related to prefix-sum?

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

      How the worst case take n^2 complexity? I think it's only take less than n^2 or am I wrong?

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

      @@GamingFlixff I think in the case of 0101010101010, that is alternate ones and zeros it will take worst time compexity.

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

    New subscriber ❤❤🎉