All Posts

Leetcode 2828: Check if a String Is an Acronym of Words

Given an array of strings words and a string s, determine if s is an acronym of words. The string s is considered an acronym of words if it can be formed by concatenating the first character of each string in words in order.

Leetcode 2833: Furthest Point From Origin

You are given a string moves consisting of characters ‘L’, ‘R’, and ‘’. The string represents movements on a number line starting from position 0. You can choose to move left or right when the character is ‘’, and the goal is to calculate the maximum distance from the origin you can reach after completing all the moves.

Leetcode 2839: Check if Strings Can be Made Equal With Operations I

You are given two strings s1 and s2, each consisting of 4 lowercase English letters. You can perform a specific operation multiple times, where you swap two characters at indices i and j such that j - i = 2. The task is to determine if it’s possible to make s1 equal to s2 after performing any number of such operations.

Leetcode 2840: Check if Strings Can be Made Equal With Operations II

You are given two strings s1 and s2, both of length n, consisting of lowercase English letters. You can perform the following operation on any of the two strings: choose any two indices i and j such that i < j and the difference j - i is even, then swap the two characters at those indices in the string. Return true if you can make s1 and s2 equal, and false otherwise.

Leetcode 2844: Minimum Operations to Make a Special Number

You are given a non-negative integer represented as a string num. In one operation, you can remove any single digit from the string. If you remove all digits, the result becomes 0. Your task is to return the minimum number of operations required to make the number divisible by 25. A number is divisible by 25 if it ends in 00, 25, 50, or 75.

Leetcode 2864: Maximum Odd Binary Number

You are given a binary string s containing at least one ‘1’. Your task is to rearrange the bits in such a way that the resulting binary number is the largest possible odd binary number that can be formed from the given bits. A binary number is odd if its least significant bit (last bit) is ‘1’. The resulting binary number may contain leading zeros.