With AI, I can just build things!
Over a decade ago, when I was building my own startup, I wrote the backend, built the web frontend and deployed the servers, created the iOS…
A personal space to share what I am learning and doing.
Over a decade ago, when I was building my own startup, I wrote the backend, built the web frontend and deployed the servers, created the iOS…
In the age of productivity tools and apps, the to-do list remains a timeless cornerstone of getting things done. But here’s the twist: there…
Leetcode: 448. Find All Numbers Disappeared in an Array Naive solution Primary idea: Check every number between 1 .. n if they are in the…
Leetcode: 128. Longest Consecutive Sequence Naive Solution Primary idea: Sort the array, remove duplicated elements then iterate through the…
While upgrading my inde app SimRecorder, I need to create a Color Picker view. Apple has introduced the ColorPicker view since iOS 14, macOS…
I’m doing some design explorations for my Minimalist Phone app. I’m trying to observe the scroll offset of a SwiftUI List. This is useful to…
Minimalism I have been an active practitioner of minimalism for a long time. My minimalism journey began when a friend gifted me a book…
SwiftUI has supported rendering Markdown texts natively recently, and it’s a great convenience to quickly render formatted texts using View…
This Swift code snippet is a minimal runable code that renders a pie chart using CAShapeLayer and UIKit. Code PieChartsView Sample…
This Swift code snippet is a minimal runable code that renders a pie chart using the Charts library. Code Result
This Swift code snippet is a minimal runable code that renders a combined bar and line chart in the same canvas using the Charts library…
Leetcode: 347. Top K Frequent Elements Naive solution using dictionary Primary idea: Use dictionary to count frequency of all elements, sort…
Leetcode: 102. Binary Tree Level Order Traversal Solution with Queue Primary idea: use a queue to help hold TreeNode, and for each level add…
Leetcode: 15. 3 Sum Primary idea: use the Two Pointers to find the remaining 2 indexes that fulfil the requirement Time Complexity: O(n^…
A heap is a specialized tree-based data structure that satisfies the heap property. There are two types of heaps: Max-Heap: In a max-heap…
Leetcode: 3. Longest Substring Without Repeating Characters Solution Primary idea: Dynamic sliding window tracking the last occurences of…
Leetcode: 973. K Closest Points to Origin Naive solution Primary idea: Calcualte the distances of all points, sort the result and pick the…
Intro At work, I usually attach a record video for my features from iOS Simulators to my merge requests. This demo video has many advantages…
Leetcode: 542. 01 Matrix Native Solution Primary idea: breadth-first search Time Complexity: O(n^2*m^2) Space Complexity: O(n*m) Optimised…
Leetcode: 57. Insert Interval Solution Primary idea: Insert not overlapped and overlapped intervals subsequently. Time Complexity: O(n…
Leetcode: 53. Maximum Subarray Solution Primary idea: Dynamic Programming, each element should be either with previous sequence or start a…
Leetcode: 217. Contains Duplicate Primary idea: Use a hash table to count frequency of all numbers in the array. Time Complexity: O(n) Space…
Leetcode: 104. Maximum Depth of Binary Tree Primary idea: Use DFS to calculate max depth of left and right node from the parent node. Time…
Recently, I have to move my app SimRecorder from Mac App Store to self publishing due to limitation of sandboxing. My app interacts with…
Leetcode: 876. Middle of the Linked List Primary idea: Slow and fast pointers, where fast pointer moves 2 steps and slow point moves 1 step…
macOS Sequoia and Xcode 16 are the hot new softwares that have recently been released in the WWDC 2024 For Apple-platform software…
Leetcode: 543. Diameter of Binary Tree Primary idea: DFS to calculate the max depth of the current node. Compare and update the global…
Is static var thread-safe? I have recently got this question in an interview. Is the following code thread safe? Let’s analyse the code a…
I have got an interview question about recently. While I can answer it correctly, I was struggling a bit when the interviewer asked me…
Leetcode: 67. Add Binary Solution Primary idea: Math: use carry and iterate from last to start Time Complexity: O(n), as we need to iterate…
Leetcode: 169. Majority Element Primary idea: Boyer-Moore Majority Voting Algorithm Time Complexity: O(n), As two traversal of the array, is…
My friend Tuan Hoang has recently published a very nice blog post about selective testing in iOS. Tokopedia team has also published a very…
Leetcode: 206. Reverse Linked List Primary idea: Iterate over the list, reverse the nodes and return the new head node. Time Complexity: O(n…
Leetcode: 409. Longest Palindrome Primary idea: Count number of character with even and odd frequencies. Adjust the final result depending…
I have just got this question in a job interview recently: Compare memory management mechanisms between Android and iOS. I know the…
I have recently got an interesting challenge when developing my latest app Quick Drop. I’m writing this short blog post to explain how to…
Leetcode: 70. Climbing Stairs Naive Solution Primary idea: Recursion to calculate fifibonacci sequence Time Complexity: O(2^n), because at…
Leetcode: 41. First Missing Positive Naive Solution Primary idea: Use Set to keep the positive numbers from the array and find the first…
Leetcode: 278. First Bad Version Primary idea: Binary search, adjust left and right pointers to narrow down the search space by checking if…
Leetcode: 383. Ransom Note Primary idea: Matching character frequencies between 2 string Time Complexity: O(m + n) Space Complexity: O(n)
Leetcode: 232. Implement Queue using Stacks Primary idea: Use an array as stack Time Complexity: O(n) Space Complexity: O(n)
Leetcode: 141. Linked List Cycle Primary idea: Floyd’s Cycle Finding Algorithm: 2 pointers, slow and fast. slow pointer advances one step at…
While working on a new feature for my QuickDrop app, I encounter an intersting challenge regarding to the . The clickable area is not the…
Leetcode: 110. Balanced Binary Tree Primary idea: Checking max depth of left and right node from the parent node and compare them. Time…
Leetcode: 235. Lowest Common Ancestor of a Binary Search Tree Primary idea: Recursively check from root to find the common accestor of p…
Leetcode: 733. Flood Fill DFS Primary idea: DFS BFS, starting from the starting node and checking the 4 neighbour nodes recursively. Time…
Leetcode: 704. Binary Search Primary idea: Binary search, adjust left and right pointers to narrow down the search space by comparing the…
Recent versions of Xcode have changed how they manage Simulator runtimes. The Xcode binaries become smaller because users will have to…
Leetcode: 242. Valid Anagram Primary idea: Compare the character freequencies of the 2 arrays Time Complexity: O(n) Space Complexity: O(n)
Leetcode: 121. Best Time to Buy and Sell Stock Primary idea: Dynamic programming, iterate through the prices and update the minimum price…