— Diary, Programming, LocalHackDay — 2 min read
So I woke up on time today, thanks to sleeping at 1:30 😆
Guess who's #13 on leaderboard. 🕺
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.
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.
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.
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!
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.
1int numRescueBoats(vector<int> &people, int limit) {2 sort(people.begin(), people.end());34 int i = 0;5 int j = people.size() - 1;6 int boats = 0;78 while (i <= j) {9 boats++;10 if (i == j) {11 break;12 }1314 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)
🎉
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!!!
Let's work on Raahee. I have a deadline and I need to deliver!