All Posts

Leetcode 2767: Partition String Into Minimum Beautiful Substrings

Given a binary string ’s’, partition it into substrings such that each substring represents a power of 5 in binary form and does not contain leading zeros. Return the minimum number of such partitions, or -1 if impossible.

Leetcode 2785: Sort Vowels in a String

You are given a string s. The task is to permute s such that all consonants remain in their original places, and the vowels are sorted in the nondecreasing order of their ASCII values.

Leetcode 2788: Split Strings by Separator

You are given an array ‘words’ of strings and a character ‘separator’. Your task is to split each string in ‘words’ by the separator. After the split, return an array of strings containing the new substrings, excluding any empty strings.

Leetcode 2800: Shortest String That Contains Three Strings

Given three strings ‘a’, ‘b’, and ‘c’, find a string that contains all three of these strings as substrings and has the minimum possible length. If there are multiple such strings, return the lexicographically smallest one.

Leetcode 2810: Faulty Keyboard

You are given a string s. On your faulty keyboard, whenever you press ‘i’, the string typed so far is reversed. Pressing any other character types it normally. Simulate typing the entire string and return the final string displayed on the screen.

Leetcode 2825: Make String a Subsequence Using Cyclic Increments

Given two strings, str1 and str2, you can perform an operation on str1 where you select a set of indices and increment the characters at those indices cyclically. The task is to check if it is possible to make str2 a subsequence of str1 by performing the operation at most once.