All Posts

Leetcode 2264: Largest 3-Same-Digit Number in String

You are given a string num representing a large integer. A ‘good’ integer is defined as a substring of length 3, consisting of only one unique digit. Your task is to find the largest ‘good’ integer in the string. If no such integer exists, return an empty string.

Leetcode 2269: Find the K-Beauty of a Number

The k-beauty of a number is defined as the number of contiguous substrings of length k that are divisors of the original number when it is read as a string. Your task is to determine the k-beauty of a given number num.

Leetcode 2273: Find Resultant Array After Removing Anagrams

You are given a 0-indexed string array words, where each element of words[i] consists of lowercase English letters. In one operation, you can delete any word words[i] if it is an anagram of the previous word words[i-1]. Repeat this operation until no more deletions are possible. Your task is to return the list of words after performing all possible operations.

Leetcode 2278: Percentage of Letter in String

You are given a string s and a character letter. Your task is to determine the percentage of characters in s that are equal to letter, rounding down to the nearest whole percent.

Leetcode 2283: Check if Number Has Equal Digit Count and Digit Value

You are given a string num consisting of digits, where each digit represents a specific number. The task is to verify if for every index i in the string, the digit at index i appears exactly num[i] times in the entire string. Return true if the condition holds for all indices, and false otherwise.

Leetcode 2287: Rearrange Characters to Make Target String

You are given two strings, s and target. Your task is to determine the maximum number of times you can rearrange the characters of s to form the string target. A character from s can only be used once in the target string, and the letters must be rearranged to form a new target string each time.