Skip to main content

Command Palette

Search for a command to run...

Day 8 in Bangalore

Updated
β€’2 min read
Day 8 in Bangalore
πŸ‘‹
Hi, I'm Pranay Sinha, a 3rd year B.Tech student with a keen interest in the tech industry and a passion for learning.

I'm on a mission to master programming and tackle any coding challenge that comes my way. In this series, you'll find my daily journal entries, presented as simple bullet points. Nothing fancyβ€”just my honest thoughts and experiences from each day. So, please, no judgment! πŸ˜‚

Join me as I document my tech journey in Bangalore. Let's dive in!

Day 8 (07/07/24)

  • Today's LeetCode was another easy one -> 1518. Water Bottles

    This one is pretty self explanatory. It just took me like around 2 mins to solve and implement it. Here's the code:

      class Solution:
          def numWaterBottles(self, numBottles: int, numExchange: int) -> int:
              numDrunk = numBottles
    
              while numBottles//numExchange:
                  numDrunk += numBottles//numExchange
                  numBottles = numBottles%numExchange + numBottles//numExchange
    
              return numDrunk
    

    Here, since we drink all the initial bottles, I'm setting numDrunk to numBottles. After that we will just keep looping as long as we have empty bottles that we can exchange and numDrunk accordingly.

  • I solved a bunch of other problems from Striver's A2Z DSA Sheet. I'm done with the easy problems on arrays. Time to move on to the medium ones now!

  • I went on a binge watching spree πŸ‘€ and completed the Season 1 and 2 of Mob Psycho. Gonna watch the Season 3 soon too.

  • Played a lot of League of Legends with friends. We probably won a couple of games. It was pretty stressful but fun as usual.

Short one today! As I spent most of my time watching anime... πŸ˜…

R

You know, it's really fun to see this every day, sometimes after, and sometimes before figuring it out on my own. Might soon become my goto article for potds. Great, wish all you the very best.

1
P

Thanks man! I'm going to include more development related stuff once I get my laptop back. So look forward to that! πŸ˜„

Bangalore Tech Diaries

Part 7 of 12

I will be documenting the journey through my days in Bangalore, starting from June 30th. No frills, just honest documentation of what I manage to accomplish each dayβ€”minus the procrastination!

Up next

Day 10 in Bangalore

πŸ‘‹ Hi, I'm Pranay Sinha, a 3rd year B.Tech student with a keen interest in the tech industry and a passion for learning. I'm on a mission to master programming and tackle any coding challenge that comes my way. In this series, you'll find my daily ...