You are given a binary string s of length n. You can perform two types of operations: (1) Flip all characters from index 0 to i (inclusive), with a cost of i + 1. (2) Flip all characters from index i to n - 1 (inclusive), with a cost of n - i. The goal is to return the minimum cost required to make all the characters in the string equal (either all 0s or all 1s).
You are given a string s. You can perform two types of operations: (1) Choose an index i and remove the closest occurrence of the character at i to the left of i. (2) Choose an index i and remove the closest occurrence of the character at i to the right of i. Minimize the length of the string s by performing these operations and return the final minimized length.
You are given a string s consisting of digits from ‘0’ to ‘9’. A string is called semi-repetitive if there is at most one pair of adjacent identical digits. Your task is to return the length of the longest semi-repetitive substring of s.
You are given a string s consisting of lowercase English letters. You can perform the operation of replacing every letter of a selected non-empty substring with the preceding letter in the alphabet. Your task is to return the lexicographically smallest string possible after performing the operation.
You are given a list of distinct strings words, where each string consists of exactly two lowercase English letters. You are tasked with finding the maximum number of pairs of strings that can be formed where one string is the reverse of the other.