Тёмный

502. IPO | heap | priority queue | leetcode daily challenge | DSA | Hindi 

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

Problem Name:
502. IPO
Problem Statement:
Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital before the IPO. Since it has limited resources, it can only finish at most k distinct projects before the IPO. Help LeetCode design the best way to maximize its total capital after finishing at most k distinct projects.
You are given n projects where the ith project has a pure profit profits[i] and a minimum capital of capital[i] is needed to start it.
Initially, you have w capital. When you finish a project, you will obtain its pure profit and the profit will be added to your total capital.
Pick a list of at most k distinct projects from given projects to maximize your final capital, and return the final maximized capital.
The answer is guaranteed to fit in a 32-bit signed integer.
Complete Balanced Trees Playlist:
• Balanced Trees Playlis...
Problem link:
leetcode.com/problems/ipo/des...
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​

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

 

14 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 22   
@sheldoncooper7990
@sheldoncooper7990 25 дней назад
Thank you for being a help in my leetcode daily challenge questions. I am on day 107. I really admire the way you teach every single thing in detail!
@shashwat_tiwari_st
@shashwat_tiwari_st 26 дней назад
please like the video if you understood the solution.
@keshavgupta9174
@keshavgupta9174 26 дней назад
@mr.nishantawasthi4402
@mr.nishantawasthi4402 26 дней назад
Starting se app se padh raha hu ....wait karta hu daily kyo ki app ka content other RU-vidrs se acha hai
@himanshuparmar3272
@himanshuparmar3272 25 дней назад
Thank You Good Explain!!
@deluluvish
@deluluvish 26 дней назад
thank u so much for explaining this. your videos are a daily motivation to atleast complete the leetcode daily challenge, even when it gets tough
@thenikhildaiya.
@thenikhildaiya. 26 дней назад
Thank you so much! Aapke explanation samajh ke khud hi code kardiya! and it did'nt even feel like a hard question.
@keshavgupta9174
@keshavgupta9174 26 дней назад
Bhai subah se wait krra tha kab ayegi video Abh kudh hi krlia 🤣😂
@yashmatlani1976
@yashmatlani1976 26 дней назад
Please provide a playlist for heaps and priority queues Not able to find out in your channel
@shashwat_tiwari_st
@shashwat_tiwari_st 25 дней назад
ru-vid.com/group/PLQ7ZAf76c0ZMMbl0ZDeFlpNJvxGWaqt9c&si=U0r_sulAUyIS_GDQ
@mr.nishantawasthi4402
@mr.nishantawasthi4402 26 дней назад
Sir java DSA course Main ab kya padhne wale hai please reply 🙏🙏
@user-oi5ls4rs5g
@user-oi5ls4rs5g 26 дней назад
java DSA course main ab kya padhne wale hai please reply aapne bola tha sir ki 1 june ko bataynge please reply
@shashwat_tiwari_st
@shashwat_tiwari_st 26 дней назад
It will be released today positively
@PiyushSharma-we8yd
@PiyushSharma-we8yd 26 дней назад
first 🤩
@priyankanagpal2207
@priyankanagpal2207 26 дней назад
Don't we have to remove all entries of max heap?
@shashwat_tiwari_st
@shashwat_tiwari_st 26 дней назад
No, not needed.
@tejas2636
@tejas2636 25 дней назад
Sir can we Solve this by Sorting in following way public int compareTo(Project p1) { if(this.capital - p1.capital != 0) return this.capital - p1.capital; return p1.profit - this.profit; } Like Ascending order Sorting based on Capital but if Capitals are equal then sort based on profit in decreasing order.. Please reply..
@shashwat_tiwari_st
@shashwat_tiwari_st 24 дня назад
Hi. I don't think think this will work.
@shashwat_tiwari_st
@shashwat_tiwari_st 24 дня назад
You have tried submitting it?
@tejas2636
@tejas2636 15 дней назад
​@@shashwat_tiwari_st Yess Sir I tried it.. It sorted the objects as we require but couldn't get correct output.. Thank you sir 🙌🏻
@TanushkaKashyap-cf7sd
@TanushkaKashyap-cf7sd 25 дней назад
wrong answers aa rhe h!
@shashwat_tiwari_st
@shashwat_tiwari_st 25 дней назад
Nhi toh. Konse test case ke liye?
Далее
DARKER SIDE of SOFTWARE ENGINEERING !!
12:09
Просмотров 125 тыс.
Java Language Futures - Spring 2024 Edition
50:47
Просмотров 17 тыс.
How I would learn Leetcode if I could start over
18:03
Просмотров 318 тыс.