life is too short for a diary



Posts Tagged: leetcode

Next Greater Element I

The next greater element of some element x in an array is the first greater element that is to the right of x in the same array...

Continue reading → leetcode python monotonic stack java



Leetcode Daily Temperatures

Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead...

Continue reading → leetcode python stack java



792. Number of Matching Subsequences

Given a string s and an array of strings words, return the number of words[i] that is a subsequence of s. A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters...

Continue reading → leetcode java