Тёмный

1482. Minimum Number of Days to Make m Bouquets | binary search | leetcode daily challenge | Hindi 

shashCode
Подписаться 16 тыс.
Просмотров 1,7 тыс.
50% 1

Problem Name:
1482. Minimum Number of Days to Make m Bouquets
Problem Statement:
You are given an integer array bloomDay, an integer m and an integer k.
You want to make m bouquets. To make a bouquet, you need to use k adjacent flowers from the garden.
The garden consists of n flowers, the ith flower will bloom in the bloomDay[i] and then can be used in exactly one bouquet.
Return the minimum number of days you need to wait to be able to make m bouquets from the garden. If it is impossible to make m bouquets return -1.
Problem link:
leetcode.com/problems/minimum...
Java Plus DSA Placement Course Playlist:
• Java and DSA Course Pl...
Java Plus DSA Sheet:
docs.google.com/spreadsheets/...
Notes:
github.com/Tiwarishashwat/Jav...
Telegram Link:
shashwattiwari.page.link/tele...
Ultimate Recursion Series Playlist:
• Recursion and Backtrac...
Instagram Handle: (@shashwat_tiwari_st)
shashwattiwari.page.link/shas...
Samsung Interview Experience:
• I cracked Samsung | SR...
Company Tags:
Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung
Timestamp:
0:00 - Introduction
#ShashwatTiwari #coding​​ #problemsolving​

Опубликовано:

 

18 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@thenikhildaiya.
@thenikhildaiya. Месяц назад
Time Complexity will be : O(N) + O(log(max-min+1) * N) O(N) for finding min & max O(log(max-min+1) * N) for binary search on range and then accessing bloomday.😊
@mr.nishantawasthi4402
@mr.nishantawasthi4402 Месяц назад
Nice explain sir
@RohitKumar-dz8dh
@RohitKumar-dz8dh Месяц назад
Thanks 😊
@PiyushSharma-we8yd
@PiyushSharma-we8yd Месяц назад
I was waiting since morning. Thankyou for teaching with ease and grace😄
@keshavgupta9174
@keshavgupta9174 Месяц назад
shashwat bhai finally ❤
@AaoJao-bl8zj
@AaoJao-bl8zj Месяц назад
amazing Explanation sir
@DarkDragon-bz6qp
@DarkDragon-bz6qp Месяц назад
Will Linked HashSet solve the issue of Sorting?
@pranatis2314
@pranatis2314 Месяц назад
can you link similar questions
@shashwat_tiwari_st
@shashwat_tiwari_st Месяц назад
ru-vid.com/group/PLQ7ZAf76c0ZNl27EcFZfyWDULnToChMUo
@dhananjoyghosh3500
@dhananjoyghosh3500 Месяц назад
Samaj nahi aya ajka
@shashwat_tiwari_st
@shashwat_tiwari_st Месяц назад
ya, this pattern is hard to understand in one go... you can solve more questions on this pattern to understand it better . ru-vid.com/group/PLQ7ZAf76c0ZNl27EcFZfyWDULnToChMUo
@MohanRam-mq2pk
@MohanRam-mq2pk Месяц назад
Make it in English then South Indians can also understand 😅
@subhamsaha9944
@subhamsaha9944 Месяц назад
You should know Hindi, you're not living in America.
@saiei
@saiei Месяц назад
class Solution { public: //lets do bruteforce approach but we will get TLE 84/93 int minDays(vector& bloomDay, int m, int k) { //base case if (m * k > bloomDay.size()) return -1; //we will create a set which will have all unique days from the bloomDay set uniqueDays(bloomDay.begin(), bloomDay.end()); //for(int i: bloomDay) //{ // uniqueDays.push_back(i); //this is not how to put in the elements in the set //} //now lets sort set //sort(set.begin(), set.end()); //no need to sort them, sets are always in sorted order only int consequtiveDays=0; int bouquetCount=0; //now we will traverse through the bloomDay vector and find out at what least day we will be able to get the ans //traverse through the set //for(int i=0;i
Далее
Я КУПИЛ САМЫЙ МОЩНЫЙ МОТОЦИКЛ!
59:15
BS-13. Minimum days to make M bouquets | Binary Search
26:01
`const` was a mistake
31:50
Просмотров 132 тыс.