michelletanpy.hashnode.devWhat I've learnt: After resigning from Big TechBackstory 🧾 In late 2022, before all the ChatGPT hype, most of the tech news headlines look something like this "Mass layoffs in [Insert well-known tech company]". It can be very unsettling to see announcements like that. Perhaps on one end, it's a ...May 30, 2023·9 min read
michelletanpy.hashnode.devLeetcode #202: Happy NumberThis problem can be solved using recursion. Thought process: Base case: Check if the number is 1. -OR- If the loop has been going on for a while. Split the digits and sum it up (square of each digit) Call the loop again until the value reaches 1 or...Sep 28, 2022·1 min read
michelletanpy.hashnode.devLeetcode #226 Invert Binary TreeThis can be solved recursively. Swap nodes and traverse left subtree then right subtree. Link: Invert Binary Tree /** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val===undefined ? 0 : val) * ...Sep 20, 2022·1 min read
michelletanpy.hashnode.devLeetcode #104 Maximum Depth of Binary TreeThis question can be solved via recursion depth first search. Keep track of the max depth. Traverse left sub tree then traverse right sub tree - increase the depth each level. Link: Maximum Depth of Binary Tree /** * Definition for a binary tree nod...Sep 19, 2022·1 min read
michelletanpy.hashnode.devWhat I've learnt: How to get unstuckProblem solving is an essential skill for any developer/software engineer. Like any other skill, it is possible to improve by repetition. The more problem solved with increased difficulty over time, the higher probability that the same problem will o...Aug 29, 2022·3 min read