All Posts

Leetcode 524: Longest Word in Dictionary through Deleting

Given a string s and a string array dictionary, return the longest string from the dictionary that can be formed by deleting some characters of s. If there are multiple valid words, return the longest word with the smallest lexicographical order. If no valid word exists, return an empty string.

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 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 556: Next Greater Element III

Given a positive integer n, find the smallest integer which can be formed by rearranging the digits of n and is greater than n. If no such integer exists, return -1.

Leetcode 557: Reverse Words in a String III

Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.