— Diary, Programming, LocalHackDay — 1 min read
I know what you wanna say - Wake up early! This is no way to live. Agreed!
Anyway I submitted a couple of challenges in MLH LocalHackDay and just completed the Leetcode Daily Challenge. Had to merge two sorted arrays in the first array. I looked at the constraints and my immediate reaction was 200 elements, that's too low so I implemented the way we merge arrays but the inplace thing turned out to be more challenging that it initially seemed. So I merged the two arrays together and did the sort on them since you know, 200.
1void merge(vector<int> &nums1, int m, vector<int> &nums2, int n) {2 if (n == 0) return;34 for (int i = 0; i < n; i++) {5 nums1[m + i] = nums2[i];6 }78 sort(nums1.begin(), nums1.end());9 return;10}
I didn't write a lot today. Most of the time I was working on MLH Local Hack Day. I have 15 points on Day 1. Could this BE any better!?
Anyway it's already 00:30 on 12th, so I'll go and work on Raahee Blog now.