All Posts

Leetcode 1930: Unique Length-3 Palindromic Subsequences

You are given a string s, and you need to return the number of unique palindromic subsequences of length 3 that are subsequences of s.

Leetcode 1935: Maximum Number of Words You Can Type

You are given a string ’text’ consisting of words separated by a single space and a string ‘brokenLetters’ containing the broken keys on a malfunctioning keyboard. Return the number of words in ’text’ that can be fully typed using the working keys.

Leetcode 1941: Check if All Characters Have Equal Number of Occurrences

Given a string s, determine if it is a ‘good’ string. A string is considered good if every character in it appears the same number of times.

Leetcode 1945: Sum of Digits of String After Convert

You are given a string consisting of lowercase English letters and an integer k. Your task is to convert the string into an integer by replacing each letter with its corresponding position in the alphabet (where ‘a’ = 1, ‘b’ = 2, …, ‘z’ = 26), and then repeatedly sum its digits k times. The final result is the integer obtained after performing the digit sum operation k times.

Leetcode 1957: Delete Characters to Make Fancy String

Given a string s, you need to remove the minimum possible number of characters to ensure that no character appears three or more times consecutively in the resulting string. The output should be the final string after all necessary deletions.

Leetcode 1961: Check If String Is a Prefix of Array

You are given a string s and an array of strings words. Determine if the string s can be formed by concatenating the first k strings from the array words, for some value of k, where 1 <= k <= words.length. Return true if s is a prefix of words, or false otherwise.