All Posts

Leetcode 2423: Remove Letter To Equalize Frequency

You are given a string consisting of lowercase English letters. You must remove one letter from the string so that the frequency of all remaining letters is equal. Return true if it is possible to achieve this by removing exactly one letter, otherwise return false.

Leetcode 2434: Using a Robot to Print the Lexicographically Smallest String

You are given a string s and a robot that starts with an empty string t. The robot can perform two operations: one, it can remove the first character of string s and append it to t, and two, it can remove the last character of string t and write it down. The goal is to return the lexicographically smallest string that can be written on paper using these operations.

Leetcode 2441: Largest Positive Integer That Exists With Its Negative

You are given an integer array nums where each element is non-zero. Your task is to find the largest positive integer k such that its negative counterpart -k also exists in the array. Return the largest such k. If no such integer exists, return -1.

Leetcode 2442: Count Number of Distinct Integers After Reverse Operations

You are given an array nums consisting of positive integers. For each number in the array, you need to reverse its digits and append the reversed number to the end of the array. After performing this operation for all numbers, return the number of distinct integers in the resulting array.

Leetcode 2451: Odd String Difference

You are given an array of strings where each string is of the same length. Each string can be converted into a difference array where each element represents the difference between two consecutive characters’ positions in the alphabet. All strings in the array have the same difference array except for one. Your task is to identify the string that has a unique difference array.

Leetcode 2453: Destroy Sequential Targets

You are given a 0-indexed array ’nums’, where each element represents a target on a number line, and an integer ‘space’. A machine is available that can destroy all targets that can be represented by the formula nums[i] + c * space, where c is a non-negative integer. You need to choose an element from ’nums’ to seed the machine such that it destroys the maximum number of targets. Return the minimum value from ’nums’ that can seed the machine to destroy the most targets.