Тёмный

1518. Water Bottles | Maths | leetcode daily challenge | DSA | Hindi 

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

Problem Name:
1518. Water Bottles
Problem Statement:
There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full water bottle.
The operation of drinking a full water bottle turns it into an empty bottle.
Given the two integers numBottles and numExchange, return the maximum number of water bottles you can drink.
Problem Link:
leetcode.com/problems/water-b...
Graph Playlist:
• Graph Data Structure S...
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​

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

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@shashwat_tiwari_st
@shashwat_tiwari_st 24 дня назад
like target for this video is 80. Please do like if you understood the solution 😄
@techgamermadno910
@techgamermadno910 23 дня назад
Hi sir! 👋 I am a beginner in coding. I have just started following your DSA course and found it very useful🥰. Most of these topics have pre-written notes. But I am confused whether I should make notes of problems. I have completed almost 20 videos. Now I am on binary search. But for now, I paused watching more videos. Rather than that I am now focusing on Leet code problem solving of Bit Manipulation as u said that u guys should start solving problems on Leet code. But the problem is that There are thousands of problems and as a beginner I feel confused which problem to take, and which problem I should mention in notes and what to write on notes whether the code or explanation or something else. Moreover, I think I can only solve problem in brute force way, some problems have many things in their topics section like dynamic programming, backtracking, etc... and I don't even know their meaning🥲. And I also had to ask that for example I have watched your Bit manipulation videos, Whether I should stop learning any other topic till I clear Bit manipulation. Like how I should manage videos with problem solving. like how many problems I have to solve on bit manipulation before moving onto the next topic. Whether I have to solve easy, medium and hard, all problems before moving onto the next topic...? or I can solve only easy and medium problems for now and move on to the next topic or I have to solve hard problems with easy and medium problems...? kindly explain me how I can manage all these things, I shall be very thankful to you for your guidance. Or u can also make a video on it to help other beginners like me as it can also be a problem of many others 😊 plz reply..!
@shashwat_tiwari_st
@shashwat_tiwari_st 23 дня назад
@@techgamermadno910 Hey, see when I said that you should solve problems, then I meant that you should do "leetcode daily challege", GFG POTD etc of the topics you have studied. Also, attend weekly contests. If any question comes (in contest or in daily challenge problems) that you haven't studied then you can skip it. Also about notes, you can check this one. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QL-XAG_8Y2k.htmlsi=YwgGI7-iEdYS5K5q Please don't stop your learning of DSA topics just because you want to solve leetcode problems. Keep them parallel!
@RohitKumar-dz8dh
@RohitKumar-dz8dh 23 дня назад
Thanks 😊 it also helped me . ​@@shashwat_tiwari_st
@RohitKumar-dz8dh
@RohitKumar-dz8dh 23 дня назад
​@@techgamermadno910Thanks to ask 😊
@techgamermadno910
@techgamermadno910 23 дня назад
@@shashwat_tiwari_st Thanks❤️
@RohitKumar-dz8dh
@RohitKumar-dz8dh 24 дня назад
Thanks 😊
@arnab027
@arnab027 23 дня назад
Brother You deserve more
@user-rz7iw4pl4i
@user-rz7iw4pl4i 23 дня назад
😊
@motivationalquotes6581
@motivationalquotes6581 24 дня назад
wait krte hain daily leetcode problem ke liye approach aagya tha mind me
@mr.nishantawasthi4402
@mr.nishantawasthi4402 24 дня назад
Nice explain sir ❤
@saiei
@saiei 24 дня назад
i solved it suing recursion though :( class Solution { public: int recurssion(int numBottles, int numExchange, int empty, int& anss) { //base case if(numBottles == 0 && empty < numExchange) return anss; //now we will solve 1 case, recurssion if(numBottles > 0) { anss = anss + numBottles; empty = empty + numBottles; numBottles = 0; } //refilling if(empty >= numExchange) { numBottles = empty / numExchange; empty = empty % numExchange; } recurssion(numBottles, numExchange, empty, anss); return anss; } int numWaterBottles(int numBottles, int numExchange) { //recurssion int anss = 0; int empty = 0; int ans = recurssion(numBottles, numExchange, empty, anss); return ans; } };
@ShivamMaurya-ee4zp
@ShivamMaurya-ee4zp 24 дня назад
Easy peasy lemon squeezy Done by itself bhaiya Just here for attendance 😅
@engineer9503
@engineer9503 23 дня назад
Hello sir thank you for making these videos
@engineer9503
@engineer9503 23 дня назад
Can you please tell me aap konsa pen tablet use krte ho
@adarshjain3058
@adarshjain3058 24 дня назад
attendance completeddd😌
@PrakashRai-ff3pr
@PrakashRai-ff3pr 23 дня назад
i did it today with 100 % beats🙂🙂
@GirjeshSharma-zv3xo
@GirjeshSharma-zv3xo 23 дня назад
Love from Russia❤
@PiyushSharma-we8yd
@PiyushSharma-we8yd 24 дня назад
Aapka channel dekhna majboori me shuru kiye the, ab maza aa rha hai💀💀
@shashwat_tiwari_st
@shashwat_tiwari_st 24 дня назад
Are are 😂
@Cosmo_Gamer
@Cosmo_Gamer 23 дня назад
numBottles + (numBottles - 1) // (numExchange - 1) one line soln
@PiyushYadav-pl9jm
@PiyushYadav-pl9jm 24 дня назад
bhai aaj constant time solution nahi samjhaya
Далее
How I would learn Leetcode if I could start over
18:03
Просмотров 382 тыс.
My Brain after 569 Leetcode Problems
7:50
Просмотров 2,5 млн
BCA to earning Crores | ezsnippet Salary Revealed 😱
30:16
8 patterns to solve 80% Leetcode problems
7:30
Просмотров 276 тыс.
DARKER SIDE of SOFTWARE ENGINEERING !!
12:09
Просмотров 136 тыс.