diff --git a/1105. Filling Bookcase Shelves b/1105. Filling Bookcase Shelves new file mode 100644 index 0000000..8f616f1 --- /dev/null +++ b/1105. Filling Bookcase Shelves @@ -0,0 +1,40 @@ +class Solution { +public: + int n,w; + vector> a; + vector dp; + int ans=INT_MAX; + int f(int i) + { + if (i>=n) + return 0; + if(dp[i]!=INT_MAX) + return dp[i]; + // int a=INT_MAX; + int cw=0,ch=0; + for(int j=i;j>& books, int w) { + + + this->n=books.size(); + this->a=books; + this->w=w; + dp.resize(n,INT_MAX); + return f(0); + + } +};