Skip to content
Paras Gupta

Jan 13 - Daily Programming Diary

— Diary, Programming, LocalHackDay — 2 min read

7:00

So I woke up on time today, thanks to sleeping at 1:30 😆

Guess who's #13 on leaderboard. 🕺

Ranking after day 2

Gonna start working on today's challenges for MLH LocalHackDay. Coming up fist is Twilio API. I was thinking about integrating Sendgrid with a project but wasn't sure if Twilio integrated with Sendgrid. I mean don't get me wrong, I have been using Sendgrid for a long time and I think I remember it being associated with Twilio but I have to check.

  1. Email-Prank: So the first project will be an application to send emails to anyone using any email address. Particularly useful when you have to pull a prank on someone, also when you wanna surprise someone 🙃 The screenshot is not worth uploading here but you can check my submission on DevPost.

  2. BattleSnake: I discovered this cool thing called BattleSnake. Oh yeah, I'll tell you what it is. It's essentially a game, not like any other game you play on your smartphone or PC, but a very sophisticated one. You remember the snake game? It's more or less like that only, the difference being that there are multiple snakes on board and you can't collide with board, yourself or them. Sounds simple? Well here's the catch, you don't play the game. You have to code a server that makes decisions based on board state about where your BattleSnake should go.

    So I decided to take it for a spin. The documentation is super unclear so I'll probably write a post about that in the future. I decided to implement just board collision avoidance for the basic version but I'll work on it in the future.

  3. Web Scraping: This was a weekly challenge but there was also a daily challenge of visualizing data in the form of a diagram (for the lack of a better word). So I decided to combine both of these. Used beautiful-soup to parse the HTML document returned and then matplotlib to generate a pie chart. 2 points here I come!

I should take a break!

16:00

Here I am, after 2 hours. Time to complete today's Leetcode Challenge. It was easy, sort and then 2 pointer approach to check if the person with greater weight can be adjusted with anyone else.

baots-to-save-poeple.cpp
1int numRescueBoats(vector<int> &people, int limit) {
2 sort(people.begin(), people.end());
3
4 int i = 0;
5 int j = people.size() - 1;
6 int boats = 0;
7
8 while (i <= j) {
9 boats++;
10 if (i == j) {
11 break;
12 }
13
14 if (people[i] + people[j] <= limit) {
15 i++;
16 }
17 j--;
18 }
19 return boats;
20}

Time complexity O(nlogn) because of sorting, and space complexity is O(1) 🎉

23:00

I worked on Raahee community page and I got really frustrated. The code for the Community page is completely unmanageable so I'll move the comments list to another component.

And I'm #7 on LocalHackDay!!!

Ranking after day 3

23:00

Let's work on Raahee. I have a deadline and I need to deliver!

EOD Checklist

  • Leetcode January Challenge
  • Raahee
  • This blog
© 2022 by Paras Gupta. All rights reserved.
Theme by LekoArts