All Posts

Leetcode 1813: Sentence Similarity III

You are given two sentences, sentence1 and sentence2, which consist of words separated by spaces. Two sentences are considered similar if you can insert any number of words (including none) into one of the sentences to make them identical. The inserted words must be separated by spaces.

Leetcode 1816: Truncate Sentence

Given a sentence with words separated by a space, truncate the sentence to contain only the first k words. Return the truncated sentence.

Leetcode 1832: Check if the Sentence Is Pangram

Given a string sentence consisting of lowercase English letters, determine whether the sentence contains every letter of the English alphabet at least once.

Leetcode 1839: Longest Substring Of All Vowels in Order

A string is considered beautiful if it satisfies the following conditions: each of the five vowels (‘a’, ’e’, ‘i’, ‘o’, ‘u’) must appear at least once, and the characters must appear in alphabetical order. Given a string word consisting of English vowels, return the length of the longest beautiful substring of word. If no such substring exists, return 0.

Leetcode 1844: Replace All Digits with Characters

You are given a string s with lowercase English letters at even indices and digits at odd indices. For each odd index i, replace the digit s[i] with the result of the operation shift(s[i-1], s[i]), where shift(c, x) returns the xth character after c. Return the modified string after replacing all digits.

Leetcode 1849: Splitting a String Into Descending Consecutive Values

Given a string s consisting of digits, check if it is possible to split it into two or more non-empty substrings such that the numerical values of the substrings are in strictly descending order and the difference between the values of adjacent substrings is exactly 1.