1105. Filling Bookcase Shelves | DP | Leetcode Daily Challenge | DSA | Hindi

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024

Комментарии • 23

  • @choudhryaysha8816
    @choudhryaysha8816 2 месяца назад +7

    👦 :- Hopefully, it will work.. and it did.. now, let's try to submit it ❤😇🥰

  • @spandansahu
    @spandansahu 2 месяца назад +6

    bhaiya...pls ek dp ka series chahiye....hope u will hear...!!

  • @mayankrathore7558
    @mayankrathore7558 2 месяца назад

    Keep doing good work!!

  • @RanjeetKumarceb
    @RanjeetKumarceb 2 месяца назад +1

    Bhaiya, you deserve a million subscribers please wait your content is very good be continue

  • @RohitKumar-dz8dh
    @RohitKumar-dz8dh 2 месяца назад

    Thanks 😊

  • @priyanshgarg1292
    @priyanshgarg1292 2 месяца назад

    your way of telling the intuition to think problem solution helps a lot ..like here you told whenever we have to do multiple task on same element it might be related to dp ...tnks sir !

  • @ishan9604
    @ishan9604 2 месяца назад +1

    Thanks from the bottom of my heart ❤❤

  • @DSAbyraj1729
    @DSAbyraj1729 2 месяца назад

    nice explanation

  • @mayanktripathi9892
    @mayanktripathi9892 2 месяца назад

    great explanation

  • @priyanshgarg1292
    @priyanshgarg1292 2 месяца назад +2

    means in case of using dp our tc becomes 2d dp size?

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  2 месяца назад

      @@priyanshgarg1292 yes, in dp we generally store all the states that our program is going to visit. So if it is 1D array O(N), 2d array then N*M, and so on..

    • @priyanshgarg1292
      @priyanshgarg1292 2 месяца назад

      @@shashwat_tiwari_st🙏

  • @mrfred456123
    @mrfred456123 2 месяца назад

    This is a memoization solution, try adding tabulation solution as well.

  • @ShivangiSingh-wc3gk
    @ShivangiSingh-wc3gk 24 дня назад

    Is memoization called DP?
    I had this before coming here- but looks like we ended up at the same O(n^2) solution
    ```
    from typing import List
    class Solution:
    def minHeightShelves(self, books: List[List[int]], shelfWidth: int) -> int:
    memo = {}
    def solveRecursive(i, current_shelf_width, current_shelf_height, total_height_so_far):
    if i >= len(books):
    return total_height_so_far + current_shelf_height
    key = (i, current_shelf_width, current_shelf_height, total_height_so_far)
    if key in memo:
    return memo[key]
    min_height = float('inf')
    if current_shelf_width + books[i][0]

    • @shashwat_tiwari_st
      @shashwat_tiwari_st  24 дня назад

      @@ShivangiSingh-wc3gk memorization is one of the type of dp or a means to achieve dp

  • @arbabsahid2969
    @arbabsahid2969 2 месяца назад

    Bhaiya I am not able to figure out the code for tabulation. Can you please upload the same ??

  • @PiyushSharma-we8yd
    @PiyushSharma-we8yd 2 месяца назад

    😍😍

  • @shubhamtrivedi2155
    @shubhamtrivedi2155 2 месяца назад

    why we didn't take height as a perameter in this question at the time of creating the dp Array

  • @Mangesh_65
    @Mangesh_65 2 месяца назад +2

    Nahi samjh aaya sir

  • @rohankumartiwary6900
    @rohankumartiwary6900 2 месяца назад

    Plz provide solutions link always

  • @shashwattiwari1502
    @shashwattiwari1502 2 месяца назад +1

    Bhaiya mera name bhi shashwta hai ❤