What I've been up to

Ramblings and teachings on topics of interest to me.

Leetcode - 11. Container With Most Water

Algorithms, Array

Think of the numbers in the array representing a height. Now, you can create an imaginary box by selecting any two numbers in the array. The max height of water that this imaginary box can hold is the minimuj of the two numbers. So what is the area of the water that can be held?

Read More

Building a TabBarView with SwiftUI

Open Source, Swift

In my last post I talked about how and why I used Google Sheets as the backend and database for the Aspire Budget apps. When I wrote that post, I had just launched version 1.0 of the app which has received some great response. However, if you did download the app, you would notice that the user interface of the app is really not appealing.

Read More

Get Random Node from Binary Search Tree

Algorithms, Binary Search Tree

Problem Statement

The goal of this challenge is to build your own BinarySearchTree class which in addition to supporting insert, find and delete also supports a special operation getRandomNode() which returns a random node from the binary search tree with special consideration that each node in the binary search tree is equally likely to be selected.

Read More