And things to learn in 2021

State of JavaScript Survey 2020 logo
The State of JavaScript Survey 2020 logo

Javascript Tools To Look Out for in 2021


On tech, philosophy, politics, and more

Photo by Sincerely Media on Unsplash

Books

Sophie’s World by Jostein Gaarder

1984 by George Orwell


An introduction to React’s upcoming feature

React server component
Image generated with Carbon.

What Are Server Components?

What Are the Advantages?


Did you know \r and \n are remnants of typewriters?

Typewriter
Photo by Bernard Hermant on Unsplash.
Hello
World!


A useful checklist for software engineers on macOS

Man admiring his MacBook Pro
Photo from Apple’s November 2020 event.


Sharing my experience building an Ionic React app

A Short History Lesson


How to settle in, a few book recommendations, and other work advice

Photo by Lauren Mancke on Unsplash

Your First Days


It’s only fair if I gave UST a grade

A+ Lecturers (and the courses I took with them)

Prof Shenghui Song (ELEC1100)


Day 2— Product of Array Except Self

O(n) runtime, O(n) space

vector<int> productExceptSelf(vector<int>& nums) {
int n = nums.size();
// Initialize vectors (i.e. arrays) of n 1’s vector<int> result(n, 1);
vector<int> fromBegin(n, 1);
vector<int> fromEnd(n, 1);
for(int i=1; i<n; i++){
fromBegin[i] = fromBegin[i-1] * nums[i-1];
fromEnd[i] = fromEnd[i-1] * nums[n-i];
}
for(int i=0; i<n; i++){
result[i] = fromBegin[i] * fromEnd[n-1-i];
}
return result;
}
  • fromBegin = [1…

Day 1 — Two Sum

nums = [2, 7, 11, 15]
target = 9
return [0, 1]

Bruteforce — O(n²) runtime, O(1) space

vector<int> twoSum(vector<int>& nums, int target) {
vector<int> result;
for(int j=1; j < nums.size(); j++){
for(int i=0; i < j; i++){
if(nums[i] + nums[j] == target){
result.push_back(i);
result.push_back(j);
return result;
}
}
}
return result; // no results found, return empty vector
}

Hash Table — O(n) runtime, O(n) space

vector<int> twoSum(vector<int>& nums, int target) {    // maps remainder (target - current_val) to vector index (i)
// e.g. …

Donovan So

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store