All Posts

Leetcode 535: Encode and Decode TinyURL

Design a URL shortening system where you can encode a long URL into a shortened URL and decode it back to the original URL. The system should guarantee that the original URL can always be retrieved using the shortened version.

Leetcode 537: Complex Number Multiplication

Given two complex numbers represented as strings, multiply them and return the result as a string in the format ‘real+imaginaryi’.

Leetcode 538: Convert BST to Greater Tree

Given the root of a Binary Search Tree (BST), convert it into a Greater Tree where every node’s value is replaced by the sum of all greater node values in the BST plus its original value.

Leetcode 539: Minimum Time Difference

Given a list of time points in ‘HH:MM’ format, return the minimum time difference between any two distinct time points in the list.

Leetcode 540: Single Element in a Sorted Array

You are given a sorted array where every element appears exactly twice, except for one element which appears only once. Find and return the single element that does not have a pair.

Leetcode 542: 01 Matrix

Given an m x n binary matrix, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1.