All Posts

Leetcode 316: Remove Duplicate Letters

Given a string ’s’, remove duplicate letters so that every letter appears once and only once. The result should be the smallest lexicographical order among all possible results.

Leetcode 402: Remove K Digits

Given a string num representing a non-negative integer and an integer k, remove k digits from num such that the remaining number is the smallest possible integer.

Leetcode 456: 132 Pattern

Given an array of integers, determine if there exists a subsequence of three integers nums[i], nums[j], nums[k] where i < j < k and nums[i] < nums[k] < nums[j]. Return true if such a subsequence exists, otherwise return false.

Leetcode 581: Shortest Unsorted Continuous Subarray

Given an integer array, find the shortest continuous subarray such that, if you sort this subarray in non-decreasing order, the whole array will become sorted.

Leetcode 654: Maximum Binary Tree

Given an integer array nums with no duplicates, construct a maximum binary tree by recursively selecting the largest number as the root, and building the left and right subtrees from the elements before and after the largest number.

Leetcode 739: Daily Temperatures

Given an array of integers temperatures representing the daily temperatures, return an array where each element is the number of days you need to wait after that day to get a warmer temperature. If there is no future day for which this is possible, keep the answer as 0.