1518. Water Bottles | O(1) time | Math | 2 Approaches

preview_player
Показать описание
In this video, I'll talk about how to solve Leetcode 1518. Water Bottles | O(1) time | Math | 2 Approaches

Let's Connect:

About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)

✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms
Рекомендации по теме
Комментарии
Автор

extremely intuitive explanation for the O(1) soln

Jazzimus
Автор

Wow great approach 💯🎉❤
Thank you so much Aryan

srinivaskoruprolu
Автор

Damm i never think of it, Great Explanation

ThisIsTheWay-ns
Автор

Thanks bhaiya for this approach. Your audio quality is so good. Can you please tell how you record audio with this clarity?

anubhavsharma
Автор

It was challenging to come up with O(1) solution 😅😅

naamnhibataunga
Автор

bro we need a solution for that binary string without adjacent zeroes using binary number system properties, I noticed that if we given n bits, then it lies between n-1 bits to n bits
within these after every perfect 2 powers or 2^n-1 - i is a perfect 2 power we need to skip some numbers ...can you please provide a solution for this, most of the solutions involve recursion and backtracking

lokesh
Автор

Start making videos on GFG POTD's

ankurverma
Автор

bro i have doubts.
if the same question is asked like this
"for each exchange we get 2 full water bottles" then we can use this formula numBottles + (numBottles - 2) / (numExchange - 2) right?

coderunner
Автор

Explanation not deep i think u copy pasted it

Death-metal